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
7fc32050
Commit
7fc32050
authored
Sep 03, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7e4e3213
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
34 deletions
+35
-34
go/neo/proto.go
go/neo/proto.go
+5
-7
go/neo/py/pyneo-gen-testdata
go/neo/py/pyneo-gen-testdata
+3
-0
go/neo/zproto-marshal.go
go/neo/zproto-marshal.go
+24
-24
go/neo/ztestdata_proto_py_test.go
go/neo/ztestdata_proto_py_test.go
+3
-3
No files found.
go/neo/proto.go
View file @
7fc32050
...
@@ -478,30 +478,28 @@ type FinishTransaction struct {
...
@@ -478,30 +478,28 @@ type FinishTransaction struct {
CheckedList
[]
zodb
.
Oid
CheckedList
[]
zodb
.
Oid
}
}
type
Answer
FinishTransaction
struct
{
type
Answer
TransactionFinished
struct
{
TT
ID
zodb
.
Tid
TT
id
zodb
.
Tid
Tid
zodb
.
Tid
Tid
zodb
.
Tid
}
}
/* XXX move vvv
// Notify that a transaction blocking a replication is now finished
// Notify that a transaction blocking a replication is now finished
// M -> S
// M -> S
type NotifyTransactionFinished struct {
type NotifyTransactionFinished struct {
TTID zodb.Tid
TTID zodb.Tid
MaxTID zodb.Tid
MaxTID zodb.Tid
}
}
*/
// XXX move vvv
/*
// Lock information on a transaction. PM -> S.
// Lock information on a transaction. PM -> S.
// Notify information on a transaction locked. S -> PM.
// Notify information on a transaction locked. S -> PM.
type
LockInformation
struct
{
type
LockInformation
struct
{
Ttid
zodb
.
Tid
Ttid
zodb
.
Tid
Tid
zodb
.
Tid
Tid
zodb
.
Tid
}
}
*/
// XXX AnswerInformationLocked ?
type
AnswerInformationLocked
struct
{
type
AnswerLockInformation
struct
{
Ttid
zodb
.
Tid
Ttid
zodb
.
Tid
}
}
...
...
go/neo/py/pyneo-gen-testdata
View file @
7fc32050
...
@@ -32,6 +32,9 @@ noask('LastIDs')
...
@@ -32,6 +32,9 @@ noask('LastIDs')
noask
(
'UnfinishedTransactions'
)
noask
(
'UnfinishedTransactions'
)
noask
(
'LockedTransactions'
)
noask
(
'LockedTransactions'
)
noask
(
'FinalTID'
)
noask
(
'FinalTID'
)
noask
(
'BeginTransaction'
)
noask
(
'FinishTransaction'
)
noask
(
'LockInformation'
)
def
main
():
def
main
():
...
...
go/neo/zproto-marshal.go
View file @
7fc32050
...
@@ -1187,26 +1187,26 @@ overflow:
...
@@ -1187,26 +1187,26 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 31. Answer
FinishTransaction
// 31. Answer
TransactionFinished
func
(
*
Answer
FinishTransaction
)
neoMsgCode
()
uint16
{
func
(
*
Answer
TransactionFinished
)
neoMsgCode
()
uint16
{
return
31
|
answerBit
return
31
|
answerBit
}
}
func
(
p
*
Answer
FinishTransaction
)
neoMsgEncodedLen
()
int
{
func
(
p
*
Answer
TransactionFinished
)
neoMsgEncodedLen
()
int
{
return
16
return
16
}
}
func
(
p
*
Answer
FinishTransaction
)
neoMsgEncode
(
data
[]
byte
)
{
func
(
p
*
Answer
TransactionFinished
)
neoMsgEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
TT
ID
))
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
TT
id
))
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
Tid
))
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
Tid
))
}
}
func
(
p
*
Answer
FinishTransaction
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
func
(
p
*
Answer
TransactionFinished
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
if
uint32
(
len
(
data
))
<
16
{
if
uint32
(
len
(
data
))
<
16
{
goto
overflow
goto
overflow
}
}
p
.
TT
ID
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
TT
id
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
Tid
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
p
.
Tid
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
return
16
,
nil
return
16
,
nil
...
@@ -1214,48 +1214,48 @@ overflow:
...
@@ -1214,48 +1214,48 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 32.
NotifyTransactionFinished
// 32.
LockInformation
func
(
*
NotifyTransactionFinished
)
neoMsgCode
()
uint16
{
func
(
*
LockInformation
)
neoMsgCode
()
uint16
{
return
32
return
32
}
}
func
(
p
*
NotifyTransactionFinished
)
neoMsgEncodedLen
()
int
{
func
(
p
*
LockInformation
)
neoMsgEncodedLen
()
int
{
return
16
return
16
}
}
func
(
p
*
NotifyTransactionFinished
)
neoMsgEncode
(
data
[]
byte
)
{
func
(
p
*
LockInformation
)
neoMsgEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
T
TID
))
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
T
tid
))
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
MaxTID
))
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
Tid
))
}
}
func
(
p
*
NotifyTransactionFinished
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
func
(
p
*
LockInformation
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
if
uint32
(
len
(
data
))
<
16
{
if
uint32
(
len
(
data
))
<
16
{
goto
overflow
goto
overflow
}
}
p
.
T
TID
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
T
tid
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
MaxTID
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
p
.
Tid
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
return
16
,
nil
return
16
,
nil
overflow
:
overflow
:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 33. Answer
LockInformation
// 33. Answer
InformationLocked
func
(
*
Answer
LockInformation
)
neoMsgCode
()
uint16
{
func
(
*
Answer
InformationLocked
)
neoMsgCode
()
uint16
{
return
33
|
answerBit
return
33
|
answerBit
}
}
func
(
p
*
Answer
LockInformation
)
neoMsgEncodedLen
()
int
{
func
(
p
*
Answer
InformationLocked
)
neoMsgEncodedLen
()
int
{
return
8
return
8
}
}
func
(
p
*
Answer
LockInformation
)
neoMsgEncode
(
data
[]
byte
)
{
func
(
p
*
Answer
InformationLocked
)
neoMsgEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
Ttid
))
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
Ttid
))
}
}
func
(
p
*
Answer
LockInformation
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
func
(
p
*
Answer
InformationLocked
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
if
uint32
(
len
(
data
))
<
8
{
if
uint32
(
len
(
data
))
<
8
{
goto
overflow
goto
overflow
}
}
...
@@ -3470,9 +3470,9 @@ var msgTypeRegistry = map[uint16]reflect.Type{
...
@@ -3470,9 +3470,9 @@ var msgTypeRegistry = map[uint16]reflect.Type{
28
|
answerBit
:
reflect
.
TypeOf
(
AnswerBeginTransaction
{}),
28
|
answerBit
:
reflect
.
TypeOf
(
AnswerBeginTransaction
{}),
29
:
reflect
.
TypeOf
(
FailedVote
{}),
29
:
reflect
.
TypeOf
(
FailedVote
{}),
30
:
reflect
.
TypeOf
(
FinishTransaction
{}),
30
:
reflect
.
TypeOf
(
FinishTransaction
{}),
31
|
answerBit
:
reflect
.
TypeOf
(
Answer
FinishTransaction
{}),
31
|
answerBit
:
reflect
.
TypeOf
(
Answer
TransactionFinished
{}),
32
:
reflect
.
TypeOf
(
NotifyTransactionFinished
{}),
32
:
reflect
.
TypeOf
(
LockInformation
{}),
33
|
answerBit
:
reflect
.
TypeOf
(
Answer
LockInformation
{}),
33
|
answerBit
:
reflect
.
TypeOf
(
Answer
InformationLocked
{}),
34
:
reflect
.
TypeOf
(
InvalidateObjects
{}),
34
:
reflect
.
TypeOf
(
InvalidateObjects
{}),
35
:
reflect
.
TypeOf
(
UnlockInformation
{}),
35
:
reflect
.
TypeOf
(
UnlockInformation
{}),
36
:
reflect
.
TypeOf
(
AskNewOIDs
{}),
36
:
reflect
.
TypeOf
(
AskNewOIDs
{}),
...
...
go/neo/ztestdata_proto_py_test.go
View file @
7fc32050
...
@@ -19,10 +19,10 @@ var pyMsgRegistry = map[uint16]string{
...
@@ -19,10 +19,10 @@ var pyMsgRegistry = map[uint16]string{
22
:
"LockedTransactions"
,
22
:
"LockedTransactions"
,
24
:
"FinalTID"
,
24
:
"FinalTID"
,
26
:
"ValidateTransaction"
,
26
:
"ValidateTransaction"
,
27
:
"
Ask
BeginTransaction"
,
27
:
"BeginTransaction"
,
29
:
"FailedVote"
,
29
:
"FailedVote"
,
30
:
"
Ask
FinishTransaction"
,
30
:
"FinishTransaction"
,
32
:
"
Ask
LockInformation"
,
32
:
"LockInformation"
,
34
:
"InvalidateObjects"
,
34
:
"InvalidateObjects"
,
35
:
"NotifyUnlockInformation"
,
35
:
"NotifyUnlockInformation"
,
36
:
"AskNewOIDs"
,
36
:
"AskNewOIDs"
,
...
...
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