Commit 7fc32050 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 7e4e3213
...@@ -478,30 +478,28 @@ type FinishTransaction struct { ...@@ -478,30 +478,28 @@ type FinishTransaction struct {
CheckedList []zodb.Oid CheckedList []zodb.Oid
} }
type AnswerFinishTransaction struct { type AnswerTransactionFinished struct {
TTID zodb.Tid TTid 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
} }
......
...@@ -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():
......
...@@ -1187,26 +1187,26 @@ overflow: ...@@ -1187,26 +1187,26 @@ overflow:
return 0, ErrDecodeOverflow return 0, ErrDecodeOverflow
} }
// 31. AnswerFinishTransaction // 31. AnswerTransactionFinished
func (*AnswerFinishTransaction) neoMsgCode() uint16 { func (*AnswerTransactionFinished) neoMsgCode() uint16 {
return 31 | answerBit return 31 | answerBit
} }
func (p *AnswerFinishTransaction) neoMsgEncodedLen() int { func (p *AnswerTransactionFinished) neoMsgEncodedLen() int {
return 16 return 16
} }
func (p *AnswerFinishTransaction) neoMsgEncode(data []byte) { func (p *AnswerTransactionFinished) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.TTID)) binary.BigEndian.PutUint64(data[0:], uint64(p.TTid))
binary.BigEndian.PutUint64(data[8:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[8:], uint64(p.Tid))
} }
func (p *AnswerFinishTransaction) neoMsgDecode(data []byte) (int, error) { func (p *AnswerTransactionFinished) neoMsgDecode(data []byte) (int, error) {
if uint32(len(data)) < 16 { if uint32(len(data)) < 16 {
goto overflow goto overflow
} }
p.TTID = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.TTid = 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.TTID)) binary.BigEndian.PutUint64(data[0:], uint64(p.Ttid))
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.TTID = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Ttid = 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. AnswerLockInformation // 33. AnswerInformationLocked
func (*AnswerLockInformation) neoMsgCode() uint16 { func (*AnswerInformationLocked) neoMsgCode() uint16 {
return 33 | answerBit return 33 | answerBit
} }
func (p *AnswerLockInformation) neoMsgEncodedLen() int { func (p *AnswerInformationLocked) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *AnswerLockInformation) neoMsgEncode(data []byte) { func (p *AnswerInformationLocked) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Ttid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Ttid))
} }
func (p *AnswerLockInformation) neoMsgDecode(data []byte) (int, error) { func (p *AnswerInformationLocked) 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(AnswerFinishTransaction{}), 31 | answerBit: reflect.TypeOf(AnswerTransactionFinished{}),
32: reflect.TypeOf(NotifyTransactionFinished{}), 32: reflect.TypeOf(LockInformation{}),
33 | answerBit: reflect.TypeOf(AnswerLockInformation{}), 33 | answerBit: reflect.TypeOf(AnswerInformationLocked{}),
34: reflect.TypeOf(InvalidateObjects{}), 34: reflect.TypeOf(InvalidateObjects{}),
35: reflect.TypeOf(UnlockInformation{}), 35: reflect.TypeOf(UnlockInformation{}),
36: reflect.TypeOf(AskNewOIDs{}), 36: reflect.TypeOf(AskNewOIDs{}),
......
...@@ -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: "AskBeginTransaction", 27: "BeginTransaction",
29: "FailedVote", 29: "FailedVote",
30: "AskFinishTransaction", 30: "FinishTransaction",
32: "AskLockInformation", 32: "LockInformation",
34: "InvalidateObjects", 34: "InvalidateObjects",
35: "NotifyUnlockInformation", 35: "NotifyUnlockInformation",
36: "AskNewOIDs", 36: "AskNewOIDs",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment