support 5.0 rdb RDB_OPCODE_MODULE_AUX, RDB_OPCODE_IDLE and RDB_OPCODE_FREQ type

v4
vinllen 6 years ago
parent 5a104fa9e3
commit 207f7d2bfb
  1. 24
      src/pkg/rdb/loader.go
  2. 12
      src/pkg/rdb/reader.go

@ -157,8 +157,28 @@ func (l *Loader) NextBinEntry() (*BinEntry, error) {
l.db = dbnum
case rdbFlagEOF:
return nil, nil
case rdbFlagOnlyValue:
fallthrough
case rdbFlagModuleAux:
// currently, ignore this filed
_, err := l.ReadLength() // module-id
if err != nil {
return nil, err
}
// skip module
if err = rdbLoadCheckModuleValue(l); err != nil {
return nil, err
}
case rdbFlagIdle:
// ignore idle because target redis doesn't support this for given key
_, err := l.ReadLength()
if err != nil {
return nil, err
}
case rdbFlagFreq:
// ignore freq because target redis doesn't support this for given key
_, err := l.readUint8()
if err != nil {
return nil, err
}
default:
var key []byte
if l.remainMember == 0 {

@ -35,13 +35,23 @@ const (
RdbTypeQuicklist = 14
RDBTypeStreamListPacks = 15 // stream
rdbFlagOnlyValue = 0xf9
rdbFlagModuleAux = 0xf7
rdbFlagIdle = 0xf8
rdbFlagFreq = 0xf9
RdbFlagAUX = 0xfa
rdbFlagResizeDB = 0xfb
rdbFlagExpiryMS = 0xfc
rdbFlagExpiry = 0xfd
rdbFlagSelectDB = 0xfe
rdbFlagEOF = 0xff
// Module serialized values sub opcodes
rdbModuleOpcodeEof = 0
rdbModuleOpcodeSint = 1
rdbModuleOpcodeUint = 2
rdbModuleOpcodeFloat = 3
rdbModuleOpcodeDouble = 4
rdbModuleOpcodeString = 5
)
const (

Loading…
Cancel
Save