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
Levin Zimmermann
neoppod
Commits
a7314b16
Commit
a7314b16
authored
Apr 04, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d14e3e7f
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
13 additions
and
18 deletions
+13
-18
neo/client/app.py
neo/client/app.py
+1
-2
neo/lib/pt.py
neo/lib/pt.py
+2
-2
neo/lib/threaded_app.py
neo/lib/threaded_app.py
+1
-1
neo/master/app.py
neo/master/app.py
+1
-1
neo/master/handlers/administration.py
neo/master/handlers/administration.py
+0
-1
neo/master/handlers/storage.py
neo/master/handlers/storage.py
+1
-1
neo/master/pt.py
neo/master/pt.py
+0
-1
neo/storage/handlers/initialization.py
neo/storage/handlers/initialization.py
+0
-1
neo/storage/handlers/storage.py
neo/storage/handlers/storage.py
+6
-7
neo/storage/replicator.py
neo/storage/replicator.py
+1
-1
No files found.
neo/client/app.py
View file @
a7314b16
...
...
@@ -228,8 +228,7 @@ class Application(ThreadedApplication):
"Too many connection failures to the primary master"
)
logging
.
info
(
'Connected to %s'
,
self
.
primary_master_node
)
try
:
# NOTE
# Request identification and required informations to be
# Request identification and required informations to be NOTE
# operational. Might raise ConnectionClosed so that the new
# primary can be looked-up again.
logging
.
info
(
'Initializing from master'
)
...
...
neo/lib/pt.py
View file @
a7314b16
...
...
@@ -212,7 +212,7 @@ class PartitionTable(object):
if
offset
>=
self
.
getPartitions
():
raise
IndexError
for
uuid
,
state
in
row
:
node
=
nm
.
getByUUID
(
uuid
)
# NOTE pt <-> nm interrelation
node
=
nm
.
getByUUID
(
uuid
)
# the node must be known by the node manager
assert
node
is
not
None
self
.
_setCell
(
offset
,
node
,
state
)
...
...
@@ -233,7 +233,7 @@ class PartitionTable(object):
break
readable_list
+=
row
for
offset
,
uuid
,
state
in
cell_list
:
node
=
nm
.
getByUUID
(
uuid
)
# NOTE pt <-> nm interrelation
node
=
nm
.
getByUUID
(
uuid
)
assert
node
is
not
None
,
'No node found for uuid '
+
uuid_str
(
uuid
)
self
.
_setCell
(
offset
,
node
,
state
)
self
.
logUpdated
()
...
...
neo/lib/threaded_app.py
View file @
a7314b16
...
...
@@ -140,7 +140,7 @@ class ThreadedApplication(BaseApplication):
_handlePacket
=
self
.
_handlePacket
while
True
:
qconn
,
qpacket
,
kw
=
get
(
True
)
if
conn
is
qconn
and
msg_id
==
qpacket
.
getId
():
# NOTE selector on msg_id
if
conn
is
qconn
and
msg_id
==
qpacket
.
getId
():
_handlePacket
(
qconn
,
qpacket
,
kw
,
handler
)
break
_handlePacket
(
qconn
,
qpacket
,
kw
)
...
...
neo/master/app.py
View file @
a7314b16
...
...
@@ -520,7 +520,7 @@ class Application(BaseApplication):
for
client_node
in
self
.
nm
.
getClientList
(
only_identified
=
True
):
if
client_node
is
transaction_node
:
client_node
.
send
(
Packets
.
AnswerTransactionFinished
(
ttid
,
tid
),
msg_id
=
txn
.
getMessageId
())
# NOTE msgid: out-of-order answer
msg_id
=
txn
.
getMessageId
())
else
:
# NOTE notifies all clients irregardless of whether who was subscribed
client_node
.
send
(
invalidate_objects
)
...
...
neo/master/handlers/administration.py
View file @
a7314b16
...
...
@@ -63,7 +63,6 @@ class AdministrationHandler(MasterHandler):
raise
ProtocolError
(
'Cannot exit recovery without any '
'storage node'
)
for
node
in
storage_list
:
# XXX note vvv ^^^
assert
node
.
isPending
(),
node
if
node
.
getConnection
().
isPending
():
# XXX: It's wrong to use ProtocolError here. We must reply
...
...
neo/master/handlers/storage.py
View file @
a7314b16
...
...
@@ -115,5 +115,5 @@ class StorageServiceHandler(BaseServiceHandler):
if
not
uid_set
:
app
.
packing
=
None
if
not
client
.
isClosed
():
client
.
send
(
Packets
.
AnswerPack
(
True
),
msg_id
)
# NOTE msg_id: out-of-order answer
client
.
send
(
Packets
.
AnswerPack
(
True
),
msg_id
)
neo/master/pt.py
View file @
a7314b16
...
...
@@ -430,7 +430,6 @@ class PartitionTable(neo.lib.pt.PartitionTable):
except
AttributeError
:
pass
# NOTE
def
setBackupTidDict
(
self
,
backup_tid_dict
):
for
row
in
self
.
partition_list
:
for
cell
in
row
:
...
...
neo/storage/handlers/initialization.py
View file @
a7314b16
...
...
@@ -80,7 +80,6 @@ class InitializationHandler(BaseMasterHandler):
dm
.
unlockTransaction
(
tid
,
ttid
)
dm
.
commit
()
# NOTE M -> S "start operational"
def
startOperation
(
self
,
conn
,
backup
):
self
.
app
.
operational
=
True
# XXX: see comment in protocol
...
...
neo/storage/handlers/storage.py
View file @
a7314b16
...
...
@@ -157,7 +157,7 @@ class StorageOperationHandler(EventHandler):
def
check
():
r
=
app
.
dm
.
checkTIDRange
(
*
args
)
try
:
conn
.
send
(
Packets
.
AnswerCheckTIDRange
(
*
r
),
msg_id
)
# NOTE msg_id: out-of-order answer
conn
.
send
(
Packets
.
AnswerCheckTIDRange
(
*
r
),
msg_id
)
except
(
weakref
.
ReferenceError
,
ConnectionClosed
):
pass
# Splitting this task would cause useless overhead. However, a
...
...
@@ -176,7 +176,7 @@ class StorageOperationHandler(EventHandler):
def
check
():
r
=
app
.
dm
.
checkSerialRange
(
*
args
)
try
:
conn
.
send
(
Packets
.
AnswerCheckSerialRange
(
*
r
),
msg_id
)
# NOTE msg_id: out-of-order answer
conn
.
send
(
Packets
.
AnswerCheckSerialRange
(
*
r
),
msg_id
)
except
(
weakref
.
ReferenceError
,
ConnectionClosed
):
pass
return
;
yield
# same as in askCheckTIDRange
...
...
@@ -186,7 +186,6 @@ class StorageOperationHandler(EventHandler):
def
askFetchTransactions
(
self
,
conn
,
partition
,
length
,
min_tid
,
max_tid
,
tid_list
):
app
=
self
.
app
# NOTE XXX
if
app
.
tm
.
isLockedTid
(
max_tid
):
# Wow, backup cluster is fast. Requested transactions are still in
# ttrans/ttobj so wait a little.
...
...
@@ -219,7 +218,7 @@ class StorageOperationHandler(EventHandler):
# Sending such packet does not mark the connection
# for writing if there's too little data in the buffer.
conn
.
send
(
Packets
.
AddTransaction
(
tid
,
user
,
desc
,
ext
,
packed
,
ttid
,
oid_list
),
msg_id
)
# NOTE msg_id: ooo answer
desc
,
ext
,
packed
,
ttid
,
oid_list
),
msg_id
)
# To avoid delaying several connections simultaneously,
# and also prevent the backend from scanning different
# parts of the DB at the same time, we ask the
...
...
@@ -228,7 +227,7 @@ class StorageOperationHandler(EventHandler):
# is flushing another one for a concurrent connection.
yield
conn
.
buffering
conn
.
send
(
Packets
.
AnswerFetchTransactions
(
pack_tid
,
next_tid
,
peer_tid_set
),
msg_id
)
# NOTE msg_id: out-of-order answer
pack_tid
,
next_tid
,
peer_tid_set
),
msg_id
)
yield
except
(
weakref
.
ReferenceError
,
ConnectionClosed
):
pass
...
...
@@ -269,10 +268,10 @@ class StorageOperationHandler(EventHandler):
%
partition
),
msg_id
)
return
# Same as in askFetchTransactions.
conn
.
send
(
Packets
.
AddObject
(
oid
,
*
object
),
msg_id
)
# NOTE msg_id: ooo answer
conn
.
send
(
Packets
.
AddObject
(
oid
,
*
object
),
msg_id
)
yield
conn
.
buffering
conn
.
send
(
Packets
.
AnswerFetchObjects
(
pack_tid
,
next_tid
,
next_oid
,
object_dict
),
msg_id
)
# NOTE msg_id: out-of-order answer
pack_tid
,
next_tid
,
next_oid
,
object_dict
),
msg_id
)
yield
except
(
weakref
.
ReferenceError
,
ConnectionClosed
):
pass
...
...
neo/storage/replicator.py
View file @
a7314b16
...
...
@@ -57,7 +57,7 @@ transactions being committed and then it is expected to fully receive from the
client any transaction that is started after this answer.
Which has in turn other consequences:
- The client must not fail to write to a storage node after the above request <-- FIXME bad
?
- The client must not fail to write to a storage node after the above request <-- FIXME bad
-> proper consensus protocol
to the master: for this, the storage must have announced it is ready, and it
must delay identification of unknown clients (those for which it hasn't
received yet a notification from the master).
...
...
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