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
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
neoppod
Commits
43029be2
Commit
43029be2
authored
Feb 20, 2020
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code clean-up, comment fixes
parent
82eea0cd
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
15 deletions
+14
-15
neo/client/app.py
neo/client/app.py
+3
-4
neo/client/handlers/master.py
neo/client/handlers/master.py
+2
-3
neo/client/transactions.py
neo/client/transactions.py
+1
-1
neo/master/app.py
neo/master/app.py
+2
-2
neo/storage/handlers/client.py
neo/storage/handlers/client.py
+1
-1
neo/storage/transactions.py
neo/storage/transactions.py
+5
-4
No files found.
neo/client/app.py
View file @
43029be2
...
@@ -674,7 +674,7 @@ class Application(ThreadedApplication):
...
@@ -674,7 +674,7 @@ class Application(ThreadedApplication):
txn_context
=
self
.
_txn_container
.
pop
(
transaction
)
txn_context
=
self
.
_txn_container
.
pop
(
transaction
)
if
txn_context
is
None
:
if
txn_context
is
None
:
return
return
# We want th
at the involved nodes
abort a transaction after any
# We want th
e involved nodes to
abort a transaction after any
# other packet sent by the client for this transaction. IOW, if we
# other packet sent by the client for this transaction. IOW, if we
# already have a connection with a storage node, potentially with
# already have a connection with a storage node, potentially with
# a pending write, aborting only via the master may lead to a race
# a pending write, aborting only via the master may lead to a race
...
@@ -703,9 +703,8 @@ class Application(ThreadedApplication):
...
@@ -703,9 +703,8 @@ class Application(ThreadedApplication):
list
(
txn_context
.
conn_dict
)))
list
(
txn_context
.
conn_dict
)))
except
ConnectionClosed
:
except
ConnectionClosed
:
pass
pass
# We don't need to flush queue, as it won't be reused by future
# No need to flush queue, as it will be destroyed on return,
# transactions (deleted on next line & indexed by transaction object
# along with txn_context.
# instance).
self
.
dispatcher
.
forget_queue
(
txn_context
.
queue
,
flush_queue
=
False
)
self
.
dispatcher
.
forget_queue
(
txn_context
.
queue
,
flush_queue
=
False
)
def
tpc_finish
(
self
,
transaction
,
f
=
None
):
def
tpc_finish
(
self
,
transaction
,
f
=
None
):
...
...
neo/client/handlers/master.py
View file @
43029be2
...
@@ -68,11 +68,10 @@ class PrimaryNotificationsHandler(MTEventHandler):
...
@@ -68,11 +68,10 @@ class PrimaryNotificationsHandler(MTEventHandler):
def
answerTransactionFinished
(
self
,
conn
,
_
,
tid
,
callback
,
cache_dict
):
def
answerTransactionFinished
(
self
,
conn
,
_
,
tid
,
callback
,
cache_dict
):
app
=
self
.
app
app
=
self
.
app
app
.
last_tid
=
tid
app
.
last_tid
=
tid
# Update cache
cache
=
app
.
_cache
cache
=
app
.
_cache
with
app
.
_cache_lock
:
invalidate
=
cache
.
invalidate
invalidate
=
app
.
_cache
.
invalidate
loading_get
=
app
.
_loading
.
get
loading_get
=
app
.
_loading
.
get
with
app
.
_cache_lock
:
for
oid
,
data
in
cache_dict
.
iteritems
():
for
oid
,
data
in
cache_dict
.
iteritems
():
# Update ex-latest value in cache
# Update ex-latest value in cache
invalidate
(
oid
,
tid
)
invalidate
(
oid
,
tid
)
...
...
neo/client/transactions.py
View file @
43029be2
...
@@ -50,7 +50,7 @@ class Transaction(object):
...
@@ -50,7 +50,7 @@ class Transaction(object):
self
.
conflict_dict
=
{}
# {oid: serial}
self
.
conflict_dict
=
{}
# {oid: serial}
# resolved conflicts
# resolved conflicts
self
.
resolved_dict
=
{}
# {oid: serial}
self
.
resolved_dict
=
{}
# {oid: serial}
# involved storage nodes; connection is None i
s
connection was lost
# involved storage nodes; connection is None i
f
connection was lost
self
.
conn_dict
=
{}
# {node_id: connection}
self
.
conn_dict
=
{}
# {node_id: connection}
def
__repr__
(
self
):
def
__repr__
(
self
):
...
...
neo/master/app.py
View file @
43029be2
...
@@ -604,7 +604,7 @@ class Application(BaseApplication):
...
@@ -604,7 +604,7 @@ class Application(BaseApplication):
node
.
send
(
Packets
.
StartOperation
(
bool
(
self
.
backup_tid
)))
node
.
send
(
Packets
.
StartOperation
(
bool
(
self
.
backup_tid
)))
uuid
=
node
.
getUUID
()
uuid
=
node
.
getUUID
()
assert
uuid
not
in
self
.
storage_starting_set
assert
uuid
not
in
self
.
storage_starting_set
if
uuid
not
in
self
.
storage_ready_dict
:
assert
uuid
not
in
self
.
storage_ready_dict
self
.
storage_starting_set
.
add
(
uuid
)
self
.
storage_starting_set
.
add
(
uuid
)
def
setStorageReady
(
self
,
uuid
):
def
setStorageReady
(
self
,
uuid
):
...
...
neo/storage/handlers/client.py
View file @
43029be2
...
@@ -34,7 +34,7 @@ class ClientOperationHandler(BaseHandler):
...
@@ -34,7 +34,7 @@ class ClientOperationHandler(BaseHandler):
app
=
self
.
app
app
=
self
.
app
if
app
.
operational
:
if
app
.
operational
:
# Even if in most cases, abortFor is called from both this method
# Even if in most cases, abortFor is called from both this method
# and BaseMasterHandler.notify
PartitionChanges
(especially since
# and BaseMasterHandler.notify
NodeInformation
(especially since
# storage nodes disconnects unknown clients on their own), these 2
# storage nodes disconnects unknown clients on their own), these 2
# handlers also cover distinct scenarios, so neither of them is
# handlers also cover distinct scenarios, so neither of them is
# redundant:
# redundant:
...
...
neo/storage/transactions.py
View file @
43029be2
...
@@ -139,6 +139,7 @@ class TransactionManager(EventQueue):
...
@@ -139,6 +139,7 @@ class TransactionManager(EventQueue):
def
replicating
(
self
,
offset_list
):
def
replicating
(
self
,
offset_list
):
self
.
_replicating
.
update
(
offset_list
)
self
.
_replicating
.
update
(
offset_list
)
if
__debug__
:
isdisjoint
=
set
(
offset_list
).
isdisjoint
isdisjoint
=
set
(
offset_list
).
isdisjoint
assert
isdisjoint
(
self
.
_replicated
),
(
offset_list
,
self
.
_replicated
)
assert
isdisjoint
(
self
.
_replicated
),
(
offset_list
,
self
.
_replicated
)
assert
isdisjoint
(
map
(
self
.
getPartition
,
self
.
_store_lock_dict
)),
(
assert
isdisjoint
(
map
(
self
.
getPartition
,
self
.
_store_lock_dict
)),
(
...
...
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