-
Notifications
You must be signed in to change notification settings - Fork 998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement deleteChunk/deleteFile for TKV engine #633
Conversation
9ed411a
to
7149d83
Compare
pkg/meta/tkv.go
Outdated
err := m.txn(func(tx kvTxn) error { | ||
buf := tx.get(key) | ||
slices = readSliceBuf(buf) | ||
tx.set(key, []byte{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tx.dels(key)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, to be aligned with redis implementation, should we leave the key with empty value there? Though i think there is no big difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they will be leaked in TiKV. Redis will cleanup the empty keys, but other KV will not.
pkg/meta/tkv.go
Outdated
} | ||
return nil | ||
}) | ||
for i, length := range lens { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the returned keys should be a valid chunk, we should iterate on that.
7149d83
to
68b3a53
Compare
pkg/meta/tkv.go
Outdated
logger.Warnf("delete chunks of inode %d: %s", inode, err) | ||
return | ||
} | ||
var vals [][]byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the vals
is not used
pkg/meta/tkv.go
Outdated
vals = tx.gets(keys...) | ||
return nil | ||
}) | ||
for i := range vals { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use keys
should be the same
No description provided.