From 6edde81abf8d77efb2c6161e2203ca63b77d9161 Mon Sep 17 00:00:00 2001 From: luzhang Date: Thu, 19 Dec 2024 14:47:13 +0800 Subject: [PATCH] fix:fix delete record assert failed Signed-off-by: luzhang --- internal/core/src/segcore/DeletedRecord.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/internal/core/src/segcore/DeletedRecord.h b/internal/core/src/segcore/DeletedRecord.h index ce2c82eb99fc2..7dd661a9afa32 100644 --- a/internal/core/src/segcore/DeletedRecord.h +++ b/internal/core/src/segcore/DeletedRecord.h @@ -83,9 +83,17 @@ class DeletedRecord { InternalPush(pks, timestamps); SortedDeleteList::Accessor accessor(deleted_lists_); - auto* last = accessor.last(); - Assert(last != nullptr); - max_load_timestamp_ = last->first; + if (!deleted_lists_->empty()) { + auto* last = accessor.last(); + Assert(last != nullptr); + max_load_timestamp_ = last->first; + } else { + for (size_t i = 0; i < pks.size(); ++i) { + if (timestamps[i] > max_load_timestamp_) { + max_load_timestamp_ = timestamps[i]; + } + } + } //TODO: add support for dump snapshot when load finished }