Compare commits

...

1 Commits

Author SHA1 Message Date
Andreja Tonev
f3734bcb5d Bugfix: Runing periodic snapshot even if in analytical mode 2024-03-19 15:07:20 +01:00
2 changed files with 4 additions and 2 deletions

View File

@ -347,8 +347,8 @@ int main(int argc, char **argv) {
"In order to use write-ahead-logging you must enable " "In order to use write-ahead-logging you must enable "
"periodic snapshots by setting the snapshot interval to a " "periodic snapshots by setting the snapshot interval to a "
"value larger than 0!"); "value larger than 0!");
db_config.durability.snapshot_wal_mode = memgraph::storage::Config::Durability::SnapshotWalMode::DISABLED;
} }
db_config.durability.snapshot_wal_mode = memgraph::storage::Config::Durability::SnapshotWalMode::DISABLED;
} else { } else {
if (FLAGS_storage_wal_enabled) { if (FLAGS_storage_wal_enabled) {
db_config.durability.snapshot_wal_mode = db_config.durability.snapshot_wal_mode =

View File

@ -28,6 +28,7 @@
#include "storage/v2/inmemory/replication/recovery.hpp" #include "storage/v2/inmemory/replication/recovery.hpp"
#include "storage/v2/inmemory/unique_constraints.hpp" #include "storage/v2/inmemory/unique_constraints.hpp"
#include "storage/v2/property_value.hpp" #include "storage/v2/property_value.hpp"
#include "storage/v2/storage_mode.hpp"
#include "utils/atomic_memory_block.hpp" #include "utils/atomic_memory_block.hpp"
#include "utils/resource_lock.hpp" #include "utils/resource_lock.hpp"
#include "utils/stat.hpp" #include "utils/stat.hpp"
@ -2287,7 +2288,8 @@ void InMemoryStorage::CreateSnapshotHandler(
}; };
// Run the snapshot thread (if enabled) // Run the snapshot thread (if enabled)
if (config_.durability.snapshot_wal_mode != Config::Durability::SnapshotWalMode::DISABLED) { if (storage_mode_ == StorageMode::IN_MEMORY_TRANSACTIONAL &&
config_.durability.snapshot_wal_mode != Config::Durability::SnapshotWalMode::DISABLED) {
snapshot_runner_.Run("Snapshot", config_.durability.snapshot_interval, [this, token = stop_source.get_token()]() { snapshot_runner_.Run("Snapshot", config_.durability.snapshot_interval, [this, token = stop_source.get_token()]() {
if (!token.stop_requested()) { if (!token.stop_requested()) {
this->create_snapshot_handler(); this->create_snapshot_handler();