Bugfix: Runing periodic snapshot even if in analytical mode

This commit is contained in:
Andreja Tonev 2024-03-19 15:07:20 +01:00
parent 2ac649f3b5
commit f3734bcb5d
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 "
"periodic snapshots by setting the snapshot interval to a "
"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 {
if (FLAGS_storage_wal_enabled) {
db_config.durability.snapshot_wal_mode =

View File

@ -28,6 +28,7 @@
#include "storage/v2/inmemory/replication/recovery.hpp"
#include "storage/v2/inmemory/unique_constraints.hpp"
#include "storage/v2/property_value.hpp"
#include "storage/v2/storage_mode.hpp"
#include "utils/atomic_memory_block.hpp"
#include "utils/resource_lock.hpp"
#include "utils/stat.hpp"
@ -2287,7 +2288,8 @@ void InMemoryStorage::CreateSnapshotHandler(
};
// 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()]() {
if (!token.stop_requested()) {
this->create_snapshot_handler();