OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace-rocks commits / 439bdae

Fix bad handling of hashes during bulk restore.
Old bug, but apparently untested and rare, if you never store anything that is alpha-convertable.
439bdae7091bbf833d36673241c2288b41801c7a
by Linas Vepstas <linasvepstas@gmail.com> · 2026-01-20T19:47:31.000Z

Changed files (1) +5 -2

opencog/persist/rocks/RocksIO.cc +5 -2
……@@ -1139,7 +1139,9 @@ void RocksStorage::loadAtoms(AtomSpace* as)
11391139 for (it->Seek("a@"); it->Valid() and it->key().starts_with("a@"); it->Next())
11401140 {
11411141 try {
1142 Handle h = Sexpr::decode_atom(it->value().ToString());
1142 std::string satom = it->value().ToString();
1143 size_t pos = satom.find('('); // skip over hash, if present
1144 Handle h = Sexpr::decode_atom(satom, pos);
11431145 h = add_nocheck(as, h);
11441146 // There's a trailing colon. Drop it.
11451147 const std::string& sidcolon = it->key().ToString().substr(2);
……@@ -1215,7 +1217,8 @@ size_t RocksStorage::loadAtomsHeight(
12151217 // Get the matching satom string.
12161218 std::string satom;
12171219 _rfile->Get(rocksdb::ReadOptions(), "a@" + sid + ":", &satom);
1218 Handle h = Sexpr::decode_atom(satom);
1220 size_t pos = satom.find('('); // skip over hash, if present
1221 Handle h = Sexpr::decode_atom(satom, pos);
12191222
12201223 // Load the values, in frame-DAG order.
12211224 for (const auto& frit: frame_order)