Commit 2f783f3a authored by Kirill Smelkov's avatar Kirill Smelkov

go/neo/proto: Sync CellState enums order with NEO/py

Corresponds to NEO/py commit b3dd6973 ("Optimize resumption of
replication by starting from a greater TID").
parent 51605c46
......@@ -201,22 +201,22 @@ const (
type CellState int32
const (
// Normal state: cell is writable/readable, and it isn't planned to drop it.
UP_TO_DATE CellState = iota //short: U // XXX tag prefix name ?
// Write-only cell. Last transactions are missing because storage is/was down
// for a while, or because it is new for the partition. It usually becomes
// UP_TO_DATE when replication is done.
OUT_OF_DATE //short: O
OUT_OF_DATE CellState = iota //short: O // XXX tag prefix name ?
// Normal state: cell is writable/readable, and it isn't planned to drop it.
UP_TO_DATE //short: U
// Same as UP_TO_DATE, except that it will be discarded as soon as another
// node finishes to replicate it. It means a partition is moved from 1 node
// to another. It is also discarded immediately if out-of-date.
FEEDING //short: F
// Not really a state: only used in network messages to tell storages to drop
// partitions.
DISCARDED //short: D
FEEDING //short: F
// A check revealed that data differs from other replicas. Cell is neither
// readable nor writable.
CORRUPTED //short: C
CORRUPTED //short: C
// Not really a state: only used in network messages to tell storages to drop
// partitions.
DISCARDED //short: D
)
// NodeUUID is a node identifier, 4-bytes signed integer
......
// Copyright (C) 2016-2017 Nexedi SA and Contributors.
// Copyright (C) 2016-2020 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
......@@ -194,9 +194,9 @@ func TestMsgMarshal(t *testing.T) {
hex("0102030405060708") +
hex("00000003") +
hex("00000001000000020000000b000000000000001100000001") +
hex("00000001000000020000000b000000010000001100000000") +
hex("00000002000000010000000b00000002") +
hex("00000007000000030000000b000000040000000f000000030000001700000000"),
hex("00000007000000030000000b000000030000000f000000040000001700000001"),
},
// map[Oid]struct {Tid,Tid,bool}
......
......@@ -99,16 +99,16 @@ func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[UP_TO_DATE-0]
_ = x[OUT_OF_DATE-1]
_ = x[OUT_OF_DATE-0]
_ = x[UP_TO_DATE-1]
_ = x[FEEDING-2]
_ = x[DISCARDED-3]
_ = x[CORRUPTED-4]
_ = x[CORRUPTED-3]
_ = x[DISCARDED-4]
}
const _CellState_name = "UP_TO_DATEOUT_OF_DATEFEEDINGDISCARDEDCORRUPTED"
const _CellState_name = "OUT_OF_DATEUP_TO_DATEFEEDINGCORRUPTEDDISCARDED"
var _CellState_index = [...]uint8{0, 10, 21, 28, 37, 46}
var _CellState_index = [...]uint8{0, 11, 21, 28, 37, 46}
func (i CellState) String() string {
if i < 0 || i >= CellState(len(_CellState_index)-1) {
......
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