Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
498fdcc6
Commit
498fdcc6
authored
Jan 16, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
55506e65
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
15 deletions
+1
-15
neo/storage/database/manager.py
neo/storage/database/manager.py
+0
-6
neo/storage/database/mysqldb.py
neo/storage/database/mysqldb.py
+1
-9
No files found.
neo/storage/database/manager.py
View file @
498fdcc6
...
@@ -23,8 +23,6 @@ from neo.lib.exception import DatabaseFailure
...
@@ -23,8 +23,6 @@ from neo.lib.exception import DatabaseFailure
from
neo.lib.interfaces
import
abstract
,
requires
from
neo.lib.interfaces
import
abstract
,
requires
from
neo.lib.protocol
import
CellStates
,
NonReadableCell
,
ZERO_TID
from
neo.lib.protocol
import
CellStates
,
NonReadableCell
,
ZERO_TID
X
=
0
def
lazymethod
(
func
):
def
lazymethod
(
func
):
def
getter
(
self
):
def
getter
(
self
):
cls
=
self
.
__class__
cls
=
self
.
__class__
...
@@ -292,10 +290,6 @@ class DatabaseManager(object):
...
@@ -292,10 +290,6 @@ class DatabaseManager(object):
return
util
.
bin
(
self
.
getConfiguration
(
'backup_tid'
))
return
util
.
bin
(
self
.
getConfiguration
(
'backup_tid'
))
def
_setBackupTID
(
self
,
tid
):
def
_setBackupTID
(
self
,
tid
):
if
X
:
print
print
'SET backup_tid: %r'
%
tid
import
traceback
;
traceback
.
print_stack
()
tid
=
util
.
dump
(
tid
)
tid
=
util
.
dump
(
tid
)
logging
.
debug
(
'backup_tid = %s'
,
tid
)
logging
.
debug
(
'backup_tid = %s'
,
tid
)
return
self
.
_setConfiguration
(
'backup_tid'
,
tid
)
return
self
.
_setConfiguration
(
'backup_tid'
,
tid
)
...
...
neo/storage/database/mysqldb.py
View file @
498fdcc6
...
@@ -370,10 +370,6 @@ class MySQLDatabaseManager(DatabaseManager):
...
@@ -370,10 +370,6 @@ class MySQLDatabaseManager(DatabaseManager):
return
util
.
p64
(
r
[
0
][
0
])
if
r
else
None
return
util
.
p64
(
r
[
0
][
0
])
if
r
else
None
def
_getNextTID
(
self
,
*
args
):
# partition, oid, tid
def
_getNextTID
(
self
,
*
args
):
# partition, oid, tid
#" USE INDEX(PRIMARY)"
# " USE KEY(`partition`, oid, tid)" says 'tid' is not in 'oid' XXX why ?
# ANSWER -> index name is SHOW INDEX FROM tbl; -> Key_name
# " FORCE INDEX(`partition`)"
r
=
self
.
query
(
"SELECT tid FROM obj"
r
=
self
.
query
(
"SELECT tid FROM obj"
" FORCE INDEX(`partition`)"
" FORCE INDEX(`partition`)"
" WHERE `partition`=%d AND oid=%d AND tid>%d"
" WHERE `partition`=%d AND oid=%d AND tid>%d"
...
@@ -744,13 +740,9 @@ class MySQLDatabaseManager(DatabaseManager):
...
@@ -744,13 +740,9 @@ class MySQLDatabaseManager(DatabaseManager):
p64
=
util
.
p64
p64
=
util
.
p64
min_tid
=
u64
(
min_tid
)
min_tid
=
u64
(
min_tid
)
max_tid
=
u64
(
max_tid
)
max_tid
=
u64
(
max_tid
)
# AND tid >= %(min_tid)d AND tid <= %(max_tid)d
# ORDER BY tid ASC LIMIT %(length)d""" % {
# ORDER BY tid ASC LIMIT %(length)d""" % {
r
=
self
.
query
(
"""SELECT tid FROM trans
r
=
self
.
query
(
"""SELECT tid FROM trans
FORCE INDEX FOR ORDER BY (PRIMARY)
WHERE `partition` = %(partition)d
WHERE `partition` = %(partition)d
AND tid
BETWEEN %(min_tid)d AND
%(max_tid)d
AND tid
>= %(min_tid)d AND tid <=
%(max_tid)d
ORDER BY tid ASC LIMIT %(length)d"""
%
{
ORDER BY tid ASC LIMIT %(length)d"""
%
{
'partition'
:
partition
,
'partition'
:
partition
,
'min_tid'
:
min_tid
,
'min_tid'
:
min_tid
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment