File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1632,13 +1632,16 @@ bool storage_db_op_flush_sync(
1632
1632
transaction_acquire (& transaction );
1633
1633
1634
1634
storage_db_entry_index_t * entry_index = NULL ;
1635
+ storage_db_database_number_t entry_database_number ;
1635
1636
if (hashtable_mcmp_op_get_by_index (
1636
1637
db -> hashtable ,
1637
- database_number ,
1638
1638
& transaction ,
1639
1639
bucket_index ,
1640
+ & entry_database_number ,
1640
1641
(void * ) & entry_index )) {
1641
- if (entry_index -> created_time_ms <= deletion_start_ms ) {
1642
+ // Ensure that the entry is from the correct database and that it's older than the deletion start time, to
1643
+ // avoid deleting entries that have been created after the flush has started
1644
+ if (database_number == entry_database_number && entry_index -> created_time_ms <= deletion_start_ms ) {
1642
1645
storage_db_op_delete_by_index (
1643
1646
db ,
1644
1647
database_number ,
Original file line number Diff line number Diff line change @@ -964,9 +964,9 @@ bool storage_db_snapshot_rdb_process_block(
964
964
storage_db_entry_index_t * entry_index = NULL ;
965
965
if (!hashtable_mcmp_op_get_by_index (
966
966
db -> hashtable ,
967
- database_number ,
968
967
& transaction ,
969
968
bucket_index ,
969
+ & database_number ,
970
970
(void * ) & entry_index )) {
971
971
goto loop_end ;
972
972
}
You can’t perform that action at this time.
0 commit comments