Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
f25b8ee3
Commit
f25b8ee3
authored
Nov 07, 2018
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: clarify several assertions
parent
4150ffb1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
17 deletions
+15
-17
neo/storage/transactions.py
neo/storage/transactions.py
+15
-17
No files found.
neo/storage/transactions.py
View file @
f25b8ee3
...
@@ -580,24 +580,22 @@ class TransactionManager(EventQueue):
...
@@ -580,24 +580,22 @@ class TransactionManager(EventQueue):
# Lockless store (we are replicating this partition),
# Lockless store (we are replicating this partition),
# or unresolved deadlock.
# or unresolved deadlock.
continue
continue
if
ttid
!=
write_locking_tid
:
if
ttid
==
write_locking_tid
:
if
__debug__
:
del
self
.
_store_lock_dict
[
oid
]
elif
__debug__
:
other
=
self
.
_transaction_dict
[
write_locking_tid
]
other
=
self
.
_transaction_dict
[
write_locking_tid
]
x
=
(
oid
,
ttid
,
write_locking_tid
,
x
=
(
oid
,
ttid
,
write_locking_tid
,
self
.
_replicated
,
transaction
.
lockless
)
self
.
_replicated
,
transaction
.
lockless
)
lockless
=
oid
in
transaction
.
lockless
assert
oid
in
other
.
serial_dict
,
x
# If there were multiple lockless writes, lockless can be
if
oid
in
transaction
.
lockless
:
# False (after a rebase) whereas the partition is still not
# notified as replicated.
assert
oid
in
other
.
serial_dict
and
not
(
lockless
and
not
self
.
_replicated
.
get
(
self
.
getPartition
(
oid
))),
x
if
not
lockless
:
assert
not
locked
,
x
continue
# unresolved deadlock
# Several lockless stores for this oid and among them,
# Several lockless stores for this oid and among them,
# a higher ttid is still pending.
# a higher ttid is still pending.
assert
transaction
<
other
,
x
assert
transaction
<
other
,
x
del
self
.
_store_lock_dict
[
oid
]
# There may remain a single lockless store so we'll need
# this partition to be checked in _notifyReplicated.
assert
self
.
_replicated
.
get
(
self
.
getPartition
(
oid
)),
x
else
:
# unresolved deadlock
assert
not
locked
,
x
# remove the transaction
# remove the transaction
del
self
.
_transaction_dict
[
ttid
]
del
self
.
_transaction_dict
[
ttid
]
if
self
.
_replicated
:
if
self
.
_replicated
:
...
...
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