From 5c4a18ecc57f58651a765b1a20787e6b10cce194 Mon Sep 17 00:00:00 2001 From: Victor Allombert Date: Mon, 12 Aug 2024 15:01:45 +0200 Subject: [PATCH 1/3] Shell: set storage_maintenance to auto by default --- src/lib_shell_services/shell_limits.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_shell_services/shell_limits.ml b/src/lib_shell_services/shell_limits.ml index 9620b1d71448..5dcd2b802db8 100644 --- a/src/lib_shell_services/shell_limits.ml +++ b/src/lib_shell_services/shell_limits.ml @@ -247,7 +247,7 @@ let chain_validator_limits_encoding = let default_disable_context_pruning = false -let default_storage_maintenance_delay = Storage_maintenance.Disabled +let default_storage_maintenance_delay = Storage_maintenance.Auto type limits = { block_validator_limits : block_validator_limits; @@ -267,7 +267,7 @@ let default_limits = chain_validator_limits = default_chain_validator_limits; history_mode = None; disable_context_pruning = Some false; - storage_maintenance_delay = Some Disabled; + storage_maintenance_delay = Some Auto; } let limits_encoding = -- GitLab From 3a69414af3d22a3517b0f612446af693c11abb73 Mon Sep 17 00:00:00 2001 From: Victor Allombert Date: Mon, 12 Aug 2024 15:02:15 +0200 Subject: [PATCH 2/3] Tezt: set storage_maintenance to auto by default --- tezt/tests/bootstrap.ml | 14 ++++++++++++-- tezt/tests/storage_maintenance.ml | 18 +++++++++++++++--- tezt/tests/storage_snapshots.ml | 7 ++++++- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/tezt/tests/bootstrap.ml b/tezt/tests/bootstrap.ml index 02f0bf01a932..8e3ecdb28b91 100644 --- a/tezt/tests/bootstrap.ml +++ b/tezt/tests/bootstrap.ml @@ -177,8 +177,18 @@ let check_bootstrap_with_history_modes hmode1 hmode2 = ] @@ fun protocol -> (* Initialize nodes and client. *) - let* node_1 = - Node.init [Synchronisation_threshold 0; Connections 1; History_mode hmode1] + let node_1_args = + (* Disable the storage maintenance delay to have a deterministic + behavior. *) + Node. + [ + Synchronisation_threshold 0; + Connections 1; + History_mode hmode1; + Storage_maintenance_delay "disabled"; + ] + in + let* node_1 = Node.init node_1_args and* node_2 = Node.init [Connections 1; History_mode hmode2] in let endpoint_1 = Client.(Node node_1) in let* node2_identity = Node.wait_for_identity node_2 in diff --git a/tezt/tests/storage_maintenance.ml b/tezt/tests/storage_maintenance.ml index 3d30fe5b85d7..ba97b494e60e 100644 --- a/tezt/tests/storage_maintenance.ml +++ b/tezt/tests/storage_maintenance.ml @@ -51,7 +51,13 @@ let test_context_pruning_call = in (* As the context pruning is enabled by default,we specify nothing on the command line. *) - let* node2 = Node.init ~name:"with_gc" Node.[Synchronisation_threshold 0] in + let* node2 = + Node.init + ~name:"with_gc" + (* Disable the storage maintenance delay to have a deterministic + behavior. *) + Node.[Synchronisation_threshold 0; Storage_maintenance_delay "disabled"] + in let* () = Client.Admin.connect_address ~peer:node2 client in let* (_ : int) = Node.wait_for_level node2 1 in let blocks_per_cycle = 8 in @@ -153,7 +159,11 @@ let test_custom_maintenance_delay = ] in let* regular_node = - Node.init ~name:"regular_node" Node.[Synchronisation_threshold 0] + Node.init + ~name:"regular_node" + (* Disable the storage maintenance delay to have a deterministic + behavior. *) + Node.[Synchronisation_threshold 0; Storage_maintenance_delay "disabled"] in let* client = Client.init ~endpoint:(Node delayed_node) () in let* () = Client.Admin.connect_address ~peer:regular_node client in @@ -315,7 +325,9 @@ let test_auto_maintenance_delay = Node.init ~name:"delayed_node" ~event_sections_levels:[("node.store", `Info)] - Node.[Synchronisation_threshold 0; Storage_maintenance_delay "auto"] + (* No need to set the storage maintenance flag, it is expected + to be set to "auto", by default, by the node. *) + Node.[Synchronisation_threshold 0] in let* client = Client.init ~endpoint:(Node delayed_node) () in let* () = diff --git a/tezt/tests/storage_snapshots.ml b/tezt/tests/storage_snapshots.ml index 60a8548167fe..ed9dad0eaaa5 100644 --- a/tezt/tests/storage_snapshots.ml +++ b/tezt/tests/storage_snapshots.ml @@ -30,7 +30,12 @@ Subject: Tests both the snapshot mechanism and the store's behaviour *) -let node_arguments = Node.[Synchronisation_threshold 0] +let team = Tag.layer1 + +let node_arguments = + (* Disable the storage maintenance delay to have a deterministic + behavior. *) + Node.[Synchronisation_threshold 0; Storage_maintenance_delay "disabled"] let pp_snapshot_export_format fmt v = Format.fprintf fmt "%s" (match v with Node.Tar -> "tar" | Raw -> "raw") -- GitLab From 53173ecde13e24ecfb4044de0f46cdc04460ed25 Mon Sep 17 00:00:00 2001 From: Victor Allombert Date: Mon, 12 Aug 2024 15:05:19 +0200 Subject: [PATCH 3/3] Changelog: set storage_maintenance to auto by default --- CHANGES.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 522e9798f11c..bf7199702cb9 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -90,6 +90,11 @@ Node - Reduced the maximum allowed timestamp drift to 1 seconds. It is recommended to use NTP to sync the clock of the node. (MR :gl:`!13198`) +- Introduced ``--storage-maintenance-delay`` to allow delaying the + storage maintenance. It is set to ``auto`` by default, to + automatically trigger the maintenance whenever it is the most + suitable. (MR :gl:`!14503`) + Client ------ -- GitLab