fix a bug of garbage collection
MODIFY
KVstore/KVstore.cpp
KVstore/KVstore.cpp
@@ -5802,7 +5802,7 @@ KVstore::o2values_literal_vacuum(vector<unsigned>& obj_literal_ids, shared_ptr<T
//cout << "_len: " << _len << endl;
//for(int i = 0; i < _len / sizeof(unsigned); i++) cout << _tmp[i] << " ";
//cout << endl;
- this->clean_dirty_key(this->objID2values, _obj_id);
+ this->clean_dirty_key(this->objID2values_literal, _obj_id - Util::LITERAL_FIRST_ID);
if(_len == 0) {
if(base_empty == false)
{

MODIFY
scripts/debug_test.cpp
scripts/debug_test.cpp
@@ -62,6 +62,23 @@ void Bug4SItree(Database *_db)
}
}
+void Bug20220408(Txn_manager &txn_m)
+{
+ string insert = "insert data {<zhangzhe> <name> \"zhangzhe\"}";
+ string remove = "delete data {<zhangzhe> <name> \"zhangzhe\"}";
+ string query = "select ?x where {<zhangzhe> ?p ?x}";
+ string res;
+ txn_id_t TID = txn_m.Begin();
+ txn_m.Query(TID, remove, res);
+ txn_m.Query(TID, query, res);
+ txn_m.Commit(TID);
+ txn_m.Checkpoint();
+ TID = txn_m.Begin();
+ txn_m.Query(TID, insert, res);
+ txn_m.Query(TID, query, res);
+ txn_m.Commit(TID);
+ txn_m.Checkpoint();
+}
int main(int argc, char* argv[])
{
@@ -71,5 +88,6 @@ int main(int argc, char* argv[])
Database _db(db_folder);
_db.load();
- Bug4SItree(&_db);
+ Txn_manager txn_m(&_db, "test");
+ Bug20220408(txn_m);
}
\ No newline at end of file

fix a bug of garbage collection