fix: do not check-fail in OpRestore (#4332)

fix: do not check-fail OpRestore

In some rare cases we reach inconsistent state inside OpRestore where a key already exists, though it should not.
In that case log the error instead of crashing the server. In addition, we update the existing entry to the latest restored value.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-12-18 09:53:03 +02:00 committed by GitHub
parent bf410b6e0b
commit c22c9448b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 52 additions and 33 deletions

View file

@ -281,6 +281,10 @@ class DbSlice {
Iterator it;
ExpIterator exp_it;
AutoUpdater post_updater;
bool IsValid() const {
return !it.is_done();
}
};
ItAndUpdater FindMutable(const Context& cntx, std::string_view key);