Skip to content
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

Merged
merged 2 commits into from
Jul 15, 2021

Conversation

xuhui-lu
Copy link
Contributor

No description provided.

@CLAassistant
Copy link

CLAassistant commented Jul 13, 2021

CLA assistant check
All committers have signed the CLA.

pkg/meta/tkv.go Outdated Show resolved Hide resolved
pkg/meta/tkv.go Outdated Show resolved Hide resolved
pkg/meta/tkv.go Outdated Show resolved Hide resolved
@xuhui-lu xuhui-lu force-pushed the xlu/delete-func branch 2 times, most recently from 9ed411a to 7149d83 Compare July 14, 2021 07:38
pkg/meta/tkv.go Outdated
err := m.txn(func(tx kvTxn) error {
buf := tx.get(key)
slices = readSliceBuf(buf)
tx.set(key, []byte{})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tx.dels(key)

Copy link
Contributor Author

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.

Copy link
Contributor

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 Show resolved Hide resolved
pkg/meta/tkv.go Outdated
}
return nil
})
for i, length := range lens {
Copy link
Contributor

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.

pkg/meta/tkv.go Outdated
logger.Warnf("delete chunks of inode %d: %s", inode, err)
return
}
var vals [][]byte
Copy link
Contributor

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 {
Copy link
Contributor

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

@davies davies changed the title Add deleteChunk/deleteFile/deleteSlice functions Add deleteChunk/deleteFile functions Jul 15, 2021
@davies davies changed the title Add deleteChunk/deleteFile functions implement deleteChunk/deleteFile for TKV engine Jul 15, 2021
@davies davies merged commit 48edfb6 into juicedata:main Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants