Fix the data is disappeared when upsert (#22762)

Signed-off-by: lixinguo <xinguo.li@zilliz.com>
Co-authored-by: lixinguo <xinguo.li@zilliz.com>
This commit is contained in:
smellthemoon 2023-03-14 19:11:54 +08:00 committed by GitHub
parent 21ba8182ee
commit 8799b06dbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -258,7 +258,10 @@ func (t *compactionTask) merge(
isDeletedValue := func(v *storage.Value) bool {
ts, ok := delta[v.PK.GetValue()]
if ok && uint64(v.Timestamp) <= ts {
// insert task and delete task has the same ts when upsert
// here should be < instead of <=
// to avoid the upsert data to be deleted after compact
if ok && uint64(v.Timestamp) < ts {
return true
}
return false