diff --git a/CHANGES.rst b/CHANGES.rst index 522e9798f11c9d79a22314a3d76cc47019f544b3..bf7199702cb92b6f1913b0baa505609dc52e9023 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 ------ diff --git a/src/lib_shell_services/shell_limits.ml b/src/lib_shell_services/shell_limits.ml index 9620b1d714488e856a0dbb5c46e178fbc36d9cdf..5dcd2b802db80acc0d5e30304593d2625a71c614 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 = diff --git a/tezt/tests/bootstrap.ml b/tezt/tests/bootstrap.ml index 02f0bf01a93275d02063dbc630d9182780abaaf5..8e3ecdb28b914cc30bd761a6717e1be1e86fb421 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 3d30fe5b85d7a941738c77b690589a07cfa06e72..ba97b494e60ea0a4df68452a0594ebdb2cc4b039 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 60a8548167fea34397dfa2887e54ed4d6d379a74..ed9dad0eaaa5770848bdbe6105a19eae19dc4c3a 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")