text stringlengths 0 601k |
|---|
let write ( Stored_data v ) data = Lwt_idle_waiter . force_idle v . scheduler ( fun ( ) -> if v . cache = data then return_unit else ( v . cache <- data ; write_file v . file data ) ) |
let create file data = let open Lwt_tzresult_syntax in let file = file in let scheduler = Lwt_idle_waiter . create ( ) in let * ( ) = write_file file data in return ( Stored_data { cache = data ; file ; scheduler } ) |
let update_with ( Stored_data v ) f = let open Lwt_syntax in Lwt_idle_waiter . force_idle v . scheduler ( fun ( ) -> let * new_data = f v . cache in if v . cache = new_data then return_ok_unit else ( v . cache <- new_data ; write_file v . file new_data ) ) |
let load file = let open Lwt_tzresult_syntax in let *! o = if Naming . is_json_file file then read_json_file file else read_file file in match o with | Some cache -> let scheduler = Lwt_idle_waiter . create ( ) in return ( Stored_data { cache ; file ; scheduler } ) | None -> fail ( Missing_stored_data ( Naming . encode... |
let init file ~ initial_data = let open Lwt_syntax in let path = Naming . encoded_file_path file in let * b = Lwt_unix . file_exists path in match b with true -> load file | false -> create file initial_data |
module type S = sig type state type key type value val empty : unit -> state val set : key -> value -> state -> state val get : key -> state -> value option val map : ( value -> value ) -> state -> state val to_string : state -> string end |
module type Map_store_param_sig = sig type key type value val key_to_string : key -> string val value_to_string : value -> string end |
module Map ( M : Map . S ) ( V : Map_store_param_sig with type key = M . key ) : S with type state = V . value M . t and type key = M . key and type value = V . value = struct type state = V . value M . t type key = M . key type value = V . value let empty ( ) = M . empty let set = M . add let get = M . find_opt let ma... |
let src = Logs . Src . create " store " |
module Log = ( val Logs . src_log src : Logs . LOG ) |
type ( ' k , ' v ) t = { tbl : ( ' k , ' v ) Hashtbl . t ; path : Fpath . t } |
module Store = Hkt . Make_store ( struct type nonrec ( ' k , ' v ) t = ( ' k , ' v ) t end ) |
let failwithf fmt = Fmt . kstr ( fun err -> raise ( Failure err ) ) fmt |
let kind_of_object path uid = let open Bos in OS . Dir . with_current path OS . Cmd . ( fun ( ) -> out_string ~ trim : true ( run_out ~ err : err_null Cmd . ( v " git " % " cat - file " % " - t " % uid ) ) ) ( ) |> R . join |> function | Ok ( " commit " , ( _ , ` Exited 0 ) ) -> R . ok ( Some ` Commit ) | Ok ( " tree "... |
let lightly_load { Sigs . return ; _ } path uid = let uid = Uid . to_hex uid in let fiber = let open Bos in kind_of_object path uid >>= function | None -> failwithf " Object <% s > not found " uid | Some kind -> let kind = match kind with | ` Commit -> ` A | ` Tree -> ` B | ` Blob -> ` C | ` Tag -> ` D in OS . Dir . wi... |
let heavily_load { Sigs . return ; _ } path uid = let uid = Uid . to_hex uid in let fiber = let open Bos in kind_of_object path uid >>= function | None -> failwithf " Object <% s > not found " uid | Some kind -> let kind , str = match kind with | ` Commit -> ` A , " commit " | ` Tree -> ` B , " tree " | ` Blob -> ` C ,... |
let parents_of_commit path uid = let open Bos in OS . Dir . with_current path OS . Cmd . ( fun ( ) -> out_lines ~ trim : true ( run_out ~ err : err_null Cmd . ( v " git " % " show " % " - s " % " -- pretty =% P " % uid ) ) ) ( ) |> R . join |> function | Ok ( uids , ( _ , ` Exited 0 ) ) -> R . ok uids | Ok ( _ , ( run_... |
let root_tree_of_commit path uid = let open Bos in OS . Dir . with_current path OS . Cmd . ( fun ( ) -> out_string ~ trim : true ( run_out ~ err : err_null Cmd . ( v " git " % " show " % " - s " % " -- pretty =% T " % uid ) ) ) ( ) |> R . join |> function | Ok ( uid , ( _ , ` Exited 0 ) ) -> R . ok uid | Ok ( _ , ( run... |
let commit_of_tag path uid = let open Bos in OS . Dir . with_current path OS . Cmd . ( fun ( ) -> out_string ~ trim : true ( run_out ~ err : err_null Cmd . ( v " git " % " rev - parse " % Fmt . str " % s { ^ commit } " uid ) ) ) ( ) |> R . join |> function | Ok ( uid , ( _ , ` Exited 0 ) ) -> R . ok uid | Ok ( _ , ( ru... |
let preds_of_tree path uid = let uid_of_line line = match Astring . String . cuts ~ sep " : " line with | _ :: _ :: uid_and_name -> ( let uid_and_name = String . concat " " uid_and_name in match Astring . String . cut ~ sep " :\ t " uid_and_name with | Some ( uid , _ ) -> R . ok uid | None -> R . error_msgf " Invalid l... |
let timestamp_of_commit path uid = let open Bos in OS . Dir . with_current path OS . Cmd . ( fun ( ) -> out_string ~ trim : true ( run_out ~ err : OS . Cmd . err_null Cmd . ( v " git " % " show " % " - s " % " -- pretty =% ct " % uid ) ) ) ( ) |> R . join |> function | Ok ( ts , ( _ , ` Exited 0 ) ) -> R . ok ( Int64 .... |
let get_object_for_packer path ( uid : Uid . t ) = kind_of_object path ( Uid . to_hex uid ) >>= function | Some ` Commit -> parents_of_commit path ( Uid . to_hex uid ) >>| List . map Uid . of_hex >>= fun preds -> root_tree_of_commit path ( Uid . to_hex uid ) >>| Uid . of_hex >>= fun root -> timestamp_of_commit path ( U... |
let get_object_for_packer { return ; _ } uid store = let { tbl ; path } = Store . prj store in match Hashtbl . find tbl uid with | v -> return ( Some v ) | exception Not_found -> ( match get_object_for_packer path uid with | Ok ( Some v ) -> Hashtbl . replace tbl uid v ; return ( Some v ) | Ok None -> return None | Err... |
let get_commit_for_negotiation path ( uid : Uid . t ) = let open Bos in OS . Dir . with_current path OS . Cmd . ( fun ( ) -> out_string ~ trim : true ( run_out ~ err : OS . Cmd . err_null Cmd . ( v " git " % " show " % " - s " % " -- pretty =% ct " % Uid . to_hex uid ) ) ) ( ) |> R . join >>= function | ts , ( _ , ` Ex... |
let parents : type s . s scheduler -> Uid . t -> ( Uid . t , Uid . t * int ref * int64 , git ) store -> ( ( Uid . t * int ref * int64 ) list , s ) io = fun { Sigs . return ; _ } uid store -> let { tbl ; path } = Store . prj store in match parents_of_commit path ( Uid . to_hex uid ) with | Ok uids -> ( let map uid = let... |
let deref : type s . s scheduler -> ( _ , _ , git ) store -> Ref . t -> ( Uid . t option , s ) io = fun { Sigs . return ; _ } store reference -> let { path ; _ } = Store . prj store in let fiber = let open Bos in OS . Dir . with_current path OS . Cmd . ( fun ( ) -> out_string ~ trim : true ( run_out ~ err : OS . Cmd . ... |
let locals : type s . s scheduler -> ( Uid . t , Uid . t * int ref * int64 , git ) store -> ( Ref . t list , s ) io = fun { Sigs . return ; _ } store -> let { path ; _ } = Store . prj store in let fiber = let open Bos in OS . Dir . with_current path OS . Cmd . ( fun ( ) -> out_lines ~ trim : true ( run_out ~ err : OS .... |
let get_commit_for_negotiation { Sigs . return ; _ } uid store = let { tbl ; path } = Store . prj store in match Hashtbl . find tbl uid with | v -> return ( Some v ) | exception Not_found -> ( match get_commit_for_negotiation path uid with | Ok ( Some obj ) -> Hashtbl . replace tbl uid obj ; return ( Some obj ) | Ok No... |
let safely_rd ~ f path = Bos . OS . File . with_ic path @@ fun ic a -> Unix . lockf ( Unix . descr_of_in_channel ic ) Unix . F_RLOCK 0 ; f ic a |
let safely_wr ~ f path = Bos . OS . File . with_oc path @@ fun oc a -> Unix . lockf ( Unix . descr_of_out_channel oc ) Unix . F_LOCK 0 ; f oc a |
let parse_shallow ic ( ) = let ln = in_channel_length ic in let rs = Bytes . create ln in really_input ic rs 0 ln ; let lst = Astring . String . fields ~ empty : true ( Bytes . unsafe_to_string rs ) in List . map Uid . of_hex lst |
let save_shallow oc lst = let ppf = Format . formatter_of_out_channel oc in let str = Fmt . str " % a " Fmt . ( list ~ sep ( : any " \ n " ) Uid . pp ) lst in Log . debug ( fun m -> m " Want to save : % S . " str ) ; Fmt . pf ppf " % a " %! Fmt . ( list ~ sep ( : any " \ n " ) Uid . pp ) lst ; Rresult . R . ok ( ) |
let shallowed { Sigs . return ; _ } store = let { path ; _ } = Store . prj store in let shallow = Fpath . ( path / " . git " / " shallow " ) in let fiber = safely_rd ~ f : parse_shallow shallow ( ) in match fiber with | Ok lst -> return lst | Error ( ` Msg err ) -> Log . warn ( fun m -> m " Got an error when we tried t... |
let identity x = x |
let always x _ = x |
let shallow { Sigs . return ; _ } store uid = let { path ; _ } = Store . prj store in let shallow = Fpath . ( path / " . git " / " shallow " ) in let fiber = let res = safely_rd ~ f : parse_shallow shallow ( ) in let shallowed = Result . fold ~ ok : identity ~ error ( : always [ ] ) res in safely_wr ~ f : save_shallow ... |
let access : type s . s scheduler -> ( Uid . t , Ref . t , Uid . t * int ref * int64 , git , s ) access = fun scheduler -> { get = get_commit_for_negotiation scheduler ; parents = parents scheduler ; deref = deref scheduler ; locals = locals scheduler ; shallowed = shallowed scheduler ; shallow = shallow scheduler ; un... |
type error += | Block_not_found of { hash : Block_hash . t ; distance : int } | Bad_level of { head_level : Int32 . t ; given_level : Int32 . t } | Block_metadata_not_found of Block_hash . t | Cannot_switch_history_mode of { previous_mode : History_mode . t ; next_mode : History_mode . t ; } | Invalid_head_switch of { ... |
let ( ) = register_error_kind ` Permanent ~ id " : store . not_found " ~ title " : Block not found " ~ description " : Block not found " ~ pp ( : fun ppf ( block_hash , distance ) -> Format . fprintf ppf " Cannot find block at distance % d from block % a . " distance Block_hash . pp block_hash ) Data_encoding . ( obj1 ... |
type cemented_store_inconsistency = | Missing_cycle of { low_cycle : string ; high_cycle : string } | Inconsistent_cycle_start of { cycle_start : Int32 . t ; expected_cycle_start : Int32 . t ; } | Bad_offset of { level : int ; cycle : string } | Unexpected_level of { block_hash : Block_hash . t ; expected : Int32 . t ;... |
let cemented_store_inconsistency_encoding = let open Data_encoding in union [ case ( Tag 0 ) ~ title " : Missing cycle " ( obj2 ( req " low_cycle " string ) ( req " high_cycle " string ) ) ( function | Missing_cycle { low_cycle ; high_cycle } -> Some ( low_cycle , high_cycle ) | _ -> None ) ( fun ( low_cycle , high_cyc... |
type store_block_error = | Invalid_block | Invalid_operations_length of { validation_passes : int ; operations : int } | Invalid_operations_data_length of { validation_passes : int ; operations_data : int ; } | Inconsistent_operations_lengths of { operations_lengths : string ; operations_data_lengths : string ; } | Inv... |
let store_block_error_encoding = let open Data_encoding in union [ case ( Tag 0 ) ~ title " : Invalid operations length " ( obj2 ( req " validation_passes " int31 ) ( req " operations " int31 ) ) ( function | Invalid_operations_length { validation_passes ; operations } -> Some ( validation_passes , operations ) | _ -> ... |
type error += | Cannot_write_in_readonly | Wrong_predecessor of Block_hash . t * int | Invalid_blocks_to_cement | Wrong_floating_kind_swap | Cannot_update_floating_store | Cannot_instanciate_temporary_floating_store | Merge_already_running | Merge_error | Cannot_load_degraded_store | Cannot_merge_store of { status : st... |
let ( ) = Error_monad . register_error_kind ` Permanent ~ id " : store . cannot_write_in_readonly " ~ title " : Cannot write in readonly " ~ description " : Cannot write data in store when in readonly " ~ pp ( : fun ppf ( ) -> Format . fprintf ppf " Cannot write data in store when in readonly . " ) Data_encoding . empt... |
type error += | Unexpected_missing_block of { block_name : string } | Unexpected_missing_block_metadata of { block_name : string } | Unexpected_missing_activation_block of { block : Block_hash . t ; protocol : Protocol_hash . t ; } | Inconsistent_genesis of { expected : Block_hash . t ; got : Block_hash . t } | Inconsi... |
let ( ) = register_error_kind ` Permanent ~ id " : store . unexpected_missing_block " ~ title " : Unexpected missing block " ~ description " : A block is unexpectedly missing from the store . " ~ pp ( : fun ppf block_name -> Format . fprintf ppf " The block ' % s ' is unexpectedly missing from the store . " block_name ... |
type corruption_kind = | Inferred_head of Block_hash . t * Int32 . t | Cannot_find_cemented_savepoint of string | Cannot_find_savepoint_candidate | Cannot_find_caboose_candidate | Cannot_find_block_with_metadata | Cannot_find_activation_block of Block_hash . t * int | Missing_genesis |
let corruption_kind_encoding = let open Data_encoding in union [ case ( Tag 0 ) ~ title " : Inferred_head " ( obj2 ( req " hash " Block_hash . encoding ) ( req " level " int32 ) ) ( function | Inferred_head ( hash , level ) -> Some ( hash , level ) | _ -> None ) ( fun ( hash , level ) -> Inferred_head ( hash , level ) ... |
let pp_corruption_kind ppf = function | Inferred_head ( hash , level ) -> Format . fprintf ppf " inferred head ( % a , % ld ) must have metadata " Block_hash . pp hash level | Cannot_find_cemented_savepoint s -> Format . fprintf ppf " failed to find a valid savepoint in the cemented store as metadata % s \ are corrupte... |
type error += Corrupted_store of corruption_kind |
let ( ) = Error_monad . register_error_kind ` Permanent ~ id " : store . corrupted_store " ~ title " : Corrupted store " ~ description " : The store is corrupted " ~ pp ( : fun ppf kind -> Format . fprintf ppf " The store is corrupted irremediably : % a . " pp_corruption_kind kind ) Data_encoding . ( obj1 ( req " kind ... |
let section = [ " node " ; " store " ] |
let set_head = declare_1 ~ section ~ level : Info ~ name " : set_head " ~ msg " { : block } set as new head " ~ pp1 : pp_block_descriptor ( " block " , block_descriptor_encoding ) |
let set_checkpoint = declare_1 ~ section ~ level : Info ~ name " : set_checkpoint " ~ msg " : checkpoint updated to { new_checkpoint } " ~ pp1 : pp_block_descriptor ( " new_checkpoint " , block_descriptor_encoding ) |
let set_target = declare_1 ~ section ~ level : Info ~ name " : set_target " ~ msg " : the target was updated to { new_target } " ~ pp1 : pp_block_descriptor ( " new_target " , block_descriptor_encoding ) |
let set_savepoint = declare_1 ~ section ~ level : Info ~ name " : set_savepoint " ~ msg " : the savepoint was updated to { new_savepoint } " ~ pp1 : pp_block_descriptor ( " new_savepoint " , block_descriptor_encoding ) |
let set_caboose = declare_1 ~ section ~ level : Info ~ name " : set_caboose " ~ msg " : the caboose was updated to { new_caboose } " ~ pp1 : pp_block_descriptor ( " new_caboose " , block_descriptor_encoding ) |
let store_block = declare_1 ~ section ~ level : Info ~ name " : store_block " ~ msg " : block { block } was stored " ~ pp1 : pp_block_descriptor ( " block " , block_descriptor_encoding ) |
let store_prechecked_block = declare_1 ~ section ~ level : Info ~ name " : store_prechecked_block " ~ msg " : prechecked block { block } was stored " ~ pp1 : pp_block_descriptor ( " block " , block_descriptor_encoding ) |
let start_updating_floating_stores = declare_0 ~ section ~ level : Info ~ name " : start_updating_floating_stores " ~ msg " : updating floating stores " ( ) |
let start_cementing_blocks = declare_0 ~ section ~ level : Info ~ name " : start_cementing_blocks " ~ msg " : cementing blocks " ( ) |
let start_cementing_blocks_metadata = declare_0 ~ section ~ level : Info ~ name " : start_cementing_blocks_metadata " ~ msg " : cementing blocks metadata " ( ) |
let start_merging_thread = declare_0 ~ section ~ level : Info ~ name " : start_merging_thread " ~ msg " : running merging thread " ( ) |
let end_merging_thread = declare_0 ~ section ~ level : Info ~ name " : end_merging_thread " ~ msg " : merging thread ended " ( ) |
let start_store_garbage_collection = declare_0 ~ section ~ level : Info ~ name " : start_store_garbage_collection " ~ msg " : garbage - collecting the cemented store " ( ) |
let start_merge_finalizer = declare_0 ~ section ~ level : Info ~ name " : start_merge_finalizer " ~ msg " : triggering merge finalizer " ( ) |
let start_retreiving_predecessors = declare_0 ~ section ~ level : Info ~ name " : start_retreiving_predecessors " ~ msg " : retrieving predecessors from floating store " ( ) |
let start_retreiving_cycles = declare_0 ~ section ~ level : Info ~ name " : start_retreiving_cycles " ~ msg " : retrieving cycles from floating store " ( ) |
let fork_testchain = declare_4 ~ section ~ level : Notice ~ name " : fork_testchain " ~ msg : " the test chain { chain_id } for protocol { protocol_hash } with genesis \ block hash { genesis_hash } was initialized from { fork_block } and is now \ registered in the store " ~ pp1 : Chain_id . pp ( " chain_id " , Chain_id... |
let pp_int32 fmt i = Format . fprintf fmt " % ld " i |
let start_merging_stores = declare_1 ~ section ~ level : Notice ~ name " : start_merging_stores " ~ msg " : merging store up to block level { lafl } " ~ pp1 : pp_int32 ( " lafl " , Data_encoding . int32 ) |
let end_merging_stores = declare_1 ~ section ~ level : Notice ~ name " : end_merging_stores " ~ msg " : store was successfully merged in { time } " ~ pp1 : Time . System . Span . pp_hum ( " time " , Time . System . Span . encoding ) |
let try_waiting_for_merge_termination = declare_0 ~ section ~ level : Notice ~ name " : try_waiting_for_merge_termination " ~ msg " : try waiting for the store ' s merge completion " ( ) |
let switch_history_mode = declare_2 ~ section ~ level : Notice ~ name " : switch_history_mode " ~ msg " : history mode successfully switched from { old } to { new } " ~ pp1 : History_mode . pp ( " old " , History_mode . encoding ) ~ pp2 : History_mode . pp ( " new " , History_mode . encoding ) |
let store_is_consistent = declare_0 ~ section ~ level : Info ~ name " : store_is_consistent " ~ msg " : the store is consistent " ( ) |
let inconsistent_store = declare_1 ~ section ~ level : Internal_event . Notice ~ name " : inconsistent_store " ~ msg " : the store is in an inconsistent state : { errs } " ~ pp1 ( : fun ppf -> Format . fprintf ppf " % a " Error_monad . pp_print_trace ) ( " errs " , Error_monad . trace_encoding ) |
let fix_store = declare_0 ~ section ~ level : Internal_event . Notice ~ name " : fix_store " ~ msg " : attempting to restore the store ' s consistency . . . " ( ) |
let fix_floating_stores = declare_0 ~ section ~ level : Internal_event . Notice ~ name " : fix_floating_stores " ~ msg " : the consistency of the floating stores was restored " ( ) |
let fix_head = declare_2 ~ section ~ level : Internal_event . Notice ~ name " : fix_head " ~ msg : " updating head ( previously { prev } ) with the fittest block present in the \ store : { new } " ~ pp1 : ( Format . pp_print_option ~ none ( : fun fmt ( ) -> Format . fprintf fmt " missing " ) ( fun fmt -> Format . fprin... |
let fix_cementing_highwatermark = let pp_cemented_highwatermark = Format . pp_print_option ~ none ( : fun fmt ( ) -> Format . fprintf fmt " None " ) ( fun fmt -> Format . fprintf fmt " % ld " ) in declare_2 ~ section ~ level : Internal_event . Notice ~ name " : fix_cementing_highwatermark " ~ msg " : updating cementing... |
let fix_checkpoint = declare_2 ~ section ~ level : Internal_event . Notice ~ name " : fix_checkpoint " ~ msg " : updating checkpoint ( previously { prev } ) with : { new } " ~ pp1 : ( Format . pp_print_option ~ none ( : fun fmt ( ) -> Format . fprintf fmt " missing " ) ( fun fmt -> Format . fprintf fmt " % a " pp_block... |
let fix_savepoint = declare_2 ~ section ~ level : Internal_event . Notice ~ name " : fix_savepoint " ~ msg : " updating savepoint ( previously { prev } ) with the lowest block with \ metadata found in the store : { new } " ~ pp1 : ( Format . pp_print_option ~ none ( : fun fmt ( ) -> Format . fprintf fmt " missing " ) (... |
let fix_caboose = declare_2 ~ section ~ level : Internal_event . Notice ~ name " : fix_caboose " ~ msg : " updating caboose ( previously { prev } ) with the lowest block found in the \ store : { new } " ~ pp1 : ( Format . pp_print_option ~ none ( : fun fmt ( ) -> Format . fprintf fmt " missing " ) ( fun fmt -> Format .... |
let store_was_fixed = declare_0 ~ section ~ level : Internal_event . Notice ~ name " : store_was_fixed " ~ msg " : the store was successfully fixed " ! ( ) |
let recover_merge = declare_0 ~ section ~ level : Internal_event . Notice ~ name " : recovering_merge " ~ msg " : recovering from an interrupted store merge " ( ) |
let restore_protocol_activation = declare_2 ~ section ~ level : Internal_event . Notice ~ name " : restore_protocol_activation " ~ msg " : protocol { protocol_level } ( { protocol_hash } ) was successfully restored " ( " protocol_level " , Data_encoding . int31 ) ~ pp2 : Protocol_hash . pp ( " protocol_hash " , Protoco... |
let update_protocol_table = declare_4 ~ section ~ level : Internal_event . Notice ~ name " : update_protocol_table " ~ msg : " the protocol table was updated : protocol { proto_hash } ( level \ { proto_level } ) was activated on block { block_hash } ( level \ { block_level } ) " ( " proto_hash " , Protocol_hash . encod... |
let restore_history_mode = declare_1 ~ section ~ level : Internal_event . Notice ~ name " : restore_history_mode " ~ msg : " history mode was successfully restored to { history_mode } , based on the \ configuration file or command line argument " ( " history_mode " , History_mode . encoding ) ~ pp1 : History_mode . pp |
let restore_inferred_history_mode = declare_1 ~ section ~ level : Internal_event . Notice ~ name " : restore_inferred_history_mode " ~ msg : " history mode was successfully restored to { history_mode } . Warning : this \ history mode may differ from the one preceding the restore procedure \ and you may need to restart ... |
let warning_incomplete_storage = declare_1 ~ level : Internal_event . Warning ~ section ~ name " : incomplete_storage " ~ msg : " the storage is missing the commit information for protocol \ { protocol_level } - operation receipt verification for this protocol \ will be unavailable " ( " protocol_level " , Data_encodin... |
let warning_missing_metadata = declare_2 ~ level : Internal_event . Warning ~ section ~ name " : missing_metadata " ~ msg : " the storage is missing some metadata for cycle \ { start_level } { - end_level } . Please consider restoring a consistent \ storage " ( " start_level " , Data_encoding . int32 ) ( " end_level " ... |
let merge_error = declare_3 ~ section ~ level : Internal_event . Error ~ name " : merge_error " ~ msg " : merge from { start } to { end } failed : { message } " ~ pp1 : pp_int32 ( " start " , Data_encoding . int32 ) ~ pp2 : pp_int32 ( " end " , Data_encoding . int32 ) ~ pp3 : Format . pp_print_string ( " message " , Da... |
let notify_merge_error = declare_1 ~ section ~ level : Internal_event . Error ~ name " : notify_merge_error " ~ msg : " store merge has failed , restart the node to restore the consistency : \ { errs } " ~ pp1 ( : fun ppf -> Format . fprintf ppf " % a " Error_monad . pp_print_trace ) ( " errs " , Error_monad . trace_en... |
type metrics = { checkpoint_level : Prometheus . Gauge . t ; savepoint_level : Prometheus . Gauge . t ; caboose_level : Prometheus . Gauge . t ; alternate_heads_count : Prometheus . Gauge . t ; } |
let metrics = let namespace = String . concat " _ " [ " node " ; " store " ] in let subsystem = None in let checkpoint_level = let help = " Current checkpoint level " in Prometheus . Gauge . v ~ help ~ namespace ? subsystem " checkpoint_level " in let savepoint_level = let help = " Current savepoint level " in Promethe... |
module T = Preface . Store . Over ( struct type t = int * int end ) |
let pos_test ( ) = let open Alcotest in let expected = ( 23 , 25 ) and computed = T . pos ( T . store fst ( 23 , 25 ) ) in check ( pair int int ) " Should be equal " expected computed ; ; |
let seek_test ( ) = let open Alcotest in let open Preface . Fun . Infix in let expected = ( 3 , 6 ) and computed = ( T . pos % T . seek ( 3 , 6 ) ) ( T . store fst ( 23 , 25 ) ) in check ( pair int int ) " Should be equal " expected computed ; ; |
let seeks_test ( ) = let open Alcotest in let open Preface . Fun . Infix in let expected = ( 25 , 23 ) and computed = ( T . pos % T . seeks Preface . Pair . swap ) ( T . store fst ( 23 , 25 ) ) in check ( pair int int ) " Should be equal " expected computed ; ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.