anchor.diff:  
   
   %% @doc Diagnosis log-related definitions
  --define(DEF_LOG_SUB_DIR,        "log/").
  +-define(DEF_LOG_SUB_DIR, "log/").
   -define(LOG_GROUP_ID_DIAGNOSIS, 'log_diagnosis_grp').
  --define(LOG_ID_DIAGNOSIS,       'log_diagnosis').
  +-define(LOG_ID_DIAGNOSIS, 'log_diagnosis').
   -define(LOG_FILENAME_DIAGNOSIS, "leo_object_storage_").
  --define(DIAGNOSIS_REP_SUFFIX,   ".report").
  +-define(DIAGNOSIS_REP_SUFFIX, ".report").
   
   
   %% @doc Output diagnosis log
  
positive.code: -undef(ST_IDLING).
  -undef(ST_RUNNING).
  -undef(ST_SUSPENDING).
  -define(ST_IDLING,     'idling').
  -define(ST_RUNNING,    'running').
  -define(ST_SUSPENDING, 'suspending').
  -type(compaction_state() :: ?ST_IDLING     |
                              ?ST_RUNNING    |
                              ?ST_SUSPENDING).
  
  
  
negative.code: 
  %% @doc Compaction-related records:
  -record(compaction_event_info, {
                                  id :: atom(),
                                  event = ?EVENT_RUN :: compaction_event(),
                                  controller_pid :: pid(),
                                  client_pid :: pid(),
                                  is_diagnosing = false :: boolean(),
                                  is_recovering = false :: boolean(),
                                  is_forced_run = false :: boolean(),
                                  callback :: function()
                                 }).
  
  -record(compaction_prms, {
                            key_bin = <<>> :: binary(),
                            body_bin = <<>> :: binary(),
                            metadata = #?METADATA{} :: #?METADATA{},
                            next_offset = 0 :: non_neg_integer()|eof,
                            start_lock_offset = 0 :: non_neg_integer(),
                            callback_fun :: function(),
                            num_of_active_objs = 0  :: non_neg_integer(),
                            size_of_active_objs = 0 :: non_neg_integer(),
                            total_num_of_objs = 0 :: non_neg_integer(),
                            total_size_of_objs = 0 :: non_neg_integer()
                           }).
  
  -record(compaction_skip_garbage, {
                                    buf = <<>> :: binary(),
                                    read_pos = 0 :: non_neg_integer(),
                                    prefetch_size = ?DEF_COMPACTION_SKIP_PS :: pos_integer(),
                                    is_skipping = false :: boolean(),
                                    is_close_eof = false :: boolean()
                                   }).
  
  -record(compaction_worker_state, {
                                    id :: atom(),
                                    obj_storage_id :: atom(),
                                    obj_storage_id_read :: atom(),
                                    meta_db_id :: atom(),
                                    obj_storage_info = #backend_info{} :: #backend_info{},
                                    compact_cntl_pid :: pid(),
                                    diagnosis_log_id :: atom(),
                                    status = ?ST_IDLING :: compaction_state(),
                                    is_locked = false :: boolean(),
                                    is_diagnosing = false :: boolean(),
                                    is_recovering = false :: boolean(),
                                    is_forced_suspending = false :: boolean(),
                                    is_skipping_garbage = false :: boolean(),
                                    %% interval_between_batch_procs:
                                    interval = 0 :: non_neg_integer(),
                                    max_interval = 0 :: non_neg_integer(),
                                    %% batch-procs:
                                    count_procs = 0 :: non_neg_integer(),
                                    num_of_batch_procs = 0 :: non_neg_integer(),
                                    max_num_of_batch_procs = 0 :: non_neg_integer(),
                                    num_of_steps = ?DEF_COMPACTION_NUM_OF_STEPS :: pos_integer(),
                                    %% compaction-info:
                                    compaction_prms = #compaction_prms{} :: #compaction_prms{},
                                    compaction_skip_garbage = #compaction_skip_garbage{} :: #compaction_skip_garbage{},
                                    skipped_bytes = 0 :: non_neg_integer(),
                                    start_datetime = 0 :: non_neg_integer(),
                                    error_pos = 0 :: non_neg_integer(),
                                    set_errors :: otp_set(),
                                    acc_errors = [] :: [{pos_integer(), pos_integer()}],
                                    result :: compaction_ret()
                                   }).
  
  %% @doc Retrieve compaction-proc's step parameters
  -define(step_compaction_proc_values(_RegBatchProcs,_RegInterval,_NumOfSteps),
  