Skip to content

Commit

Permalink
Set move key's expiresAt for keys with TTL (#1006)
Browse files Browse the repository at this point in the history
The value log GC moves keys from one value log file to another. The
current implementation of vlog GC would not copy the TTL from the
original entry to the new move key. This commit fixes that.

Without this change, the move keys were not being removed as seen
in issue #974.
With this commit, the move keys are being removed.

(cherry picked from commit d1c0fba)
  • Loading branch information
Ibrahim Jarif committed Mar 12, 2020
1 parent f16e2d3 commit 7db9c3e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions value.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ func (vlog *valueLog) rewrite(f *logFile, tr trace.Trace) error {
ne := new(Entry)
ne.meta = 0 // Remove all bits. Different keyspace doesn't need these bits.
ne.UserMeta = e.UserMeta
ne.ExpiresAt = e.ExpiresAt

// Create a new key in a separate keyspace, prefixed by moveKey. We are not
// allowed to rewrite an older version of key in the LSM tree, because then this older
Expand Down

0 comments on commit 7db9c3e

Please sign in to comment.