Skip to content

Commit

Permalink
fix(restore): Set kv version to restoreTs for rolled up keys and sche…
Browse files Browse the repository at this point in the history
…ma keys (#7930)

The kv version should be set to restore timestamp for rolled-up keys 
and schema keys as well.
  • Loading branch information
ahsanbarkati authored Jun 28, 2021
1 parent b85036e commit 01ee32f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions worker/restore_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,9 @@ func (m *mapper) processReqCh(ctx context.Context) error {
return err
}
for _, kv := range kvs {
if err := toBuffer(kv, kv.Version); err != nil {
version := kv.Version
kv.Version = m.restoreTs
if err := toBuffer(kv, version); err != nil {
return err
}
}
Expand Down Expand Up @@ -448,8 +450,10 @@ func (m *mapper) processReqCh(ctx context.Context) error {
kv.StreamId = 0
// Schema and type keys are not stored in an intermediate format so their
// value can be written as is.
version := kv.Version
kv.Version = m.restoreTs
kv.Key = restoreKey
if err := toBuffer(kv, kv.Version); err != nil {
if err := toBuffer(kv, version); err != nil {
return err
}

Expand Down

0 comments on commit 01ee32f

Please sign in to comment.