From 3dca5122855a2bab2b7d0d92cc10f9516933dcf2 Mon Sep 17 00:00:00 2001 From: armink Date: Sun, 19 Nov 2023 11:06:12 +0800 Subject: [PATCH] [kvdb] Improve the GC speed when in recovery mode. --- src/fdb_kvdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fdb_kvdb.c b/src/fdb_kvdb.c index 35f90f2..d64b1b1 100644 --- a/src/fdb_kvdb.c +++ b/src/fdb_kvdb.c @@ -981,7 +981,7 @@ static fdb_err_t move_kv(fdb_kvdb_t db, fdb_kv_t kv) } if ((kv_addr = alloc_kv(db, §or, kv->len)) != FAILED_ADDR) { - if (db->in_recovery_check) { + if (db->in_recovery_check && kv->status == FDB_KV_PRE_DELETE) { struct fdb_kv kv_bak; char name[FDB_KV_NAME_MAX + 1] = { 0 }; strncpy(name, kv->name, kv->name_len);