Skip to content

Commit e5ab9f7

Browse files
committed
Fix FetchSnapshot in more recent Tarantool versions
1 parent 5711080 commit e5ab9f7

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

anon_slave_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ func TestAnonSlaveSubscribeExpectedReplicaSetUUIDFail(t *testing.T) {
156156

157157
ver, err := tntBoxVersion(box)
158158
require.NoError(err)
159-
if ver >= version2_8_0 && ver < version2_9_0 {
160-
t.Skip("Tarantool 2.8 returns an empty replicaset UUID, skip check")
159+
if ver >= version2_8_0 && ver < version2_9_0 || ver >= version2_11_0 {
160+
t.Skip("Tarantool 2.8/2.11 returns an empty replicaset UUID, skip check")
161161
}
162162

163163
s, _ := NewAnonSlave(box.Listen, Options{

const.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const (
3232
KeyLSN = uint(0x03)
3333
KeyTimestamp = uint(0x04)
3434
KeySchemaID = uint(0x05)
35+
KeyVersionID = uint(0x06)
3536
KeySpaceNo = uint(0x10)
3637
KeyIndexNo = uint(0x11)
3738
KeyLimit = uint(0x12)
@@ -378,7 +379,8 @@ const (
378379
// 2.3.1 is min version for anonymous replication
379380
version2_3_1 = uint32(131841) // VersionID(2, 3, 1)
380381
// Add box.info.replication_anon
381-
version2_5_1 = uint32(132353) // VersionID(2, 5, 1)
382-
version2_8_0 = uint32(133120) // VersionID(2, 8, 0)
383-
version2_9_0 = uint32(133376) // VersionID(2, 9, 0)
382+
version2_5_1 = uint32(132353) // VersionID(2, 5, 1)
383+
version2_8_0 = uint32(133120) // VersionID(2, 8, 0)
384+
version2_9_0 = uint32(133376) // VersionID(2, 9, 0)
385+
version2_11_0 = uint32(133888) // VersionID(2, 11, 0)
384386
)

fetch_snapshot.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package tarantool
22

3+
import "github.com/tinylib/msgp/msgp"
4+
35
// FetchSnapshot is the FETCH_SNAPSHOT command
46
type FetchSnapshot struct{}
57

@@ -12,6 +14,9 @@ func (q *FetchSnapshot) GetCommandID() uint {
1214
// MarshalMsg implements msgp.Marshaler
1315
func (q *FetchSnapshot) MarshalMsg(b []byte) (o []byte, err error) {
1416
o = b
17+
o = msgp.AppendMapHeader(o, 1)
18+
o = msgp.AppendUint(o, KeyVersionID)
19+
o = msgp.AppendUint(o, uint(version2_9_0))
1520
return o, nil
1621
}
1722

0 commit comments

Comments
 (0)