@@ -2794,12 +2794,17 @@ pub struct HistoryLogConfig {
2794
2794
#[ serde( rename = "tables" ) ]
2795
2795
pub log_history_tables : Vec < HistoryLogTableConfig > ,
2796
2796
2797
- /// Specifies the storage parameters for the history log
2797
+ /// Specifies whether enable external storage
2798
+ /// If set to false (default), the default storage parameters from `[storage]` will be used.
2799
+ #[ clap( skip) ]
2800
+ #[ serde( rename = "storage_on" , default ) ]
2801
+ pub log_history_external_storage_on : bool ,
2802
+
2803
+ /// Specifies the external storage parameters for the history log
2798
2804
/// This is used to configure how the history log data is stored.
2799
- /// If not specified, the default storage parameters from `[storage]` will be used.
2800
2805
#[ clap( skip) ]
2801
2806
#[ serde( rename = "storage" ) ]
2802
- pub log_history_storage_params : Option < StorageConfig > ,
2807
+ pub log_history_storage_params : StorageConfig ,
2803
2808
}
2804
2809
2805
2810
#[ derive( Clone , Debug , PartialEq , Eq , Serialize , Deserialize ) ]
@@ -2849,12 +2854,11 @@ impl TryInto<InnerHistoryConfig> for HistoryLogConfig {
2849
2854
type Error = ErrorCode ;
2850
2855
2851
2856
fn try_into ( self ) -> Result < InnerHistoryConfig > {
2852
- let storage_params: Option < InnerStorageConfig > =
2853
- if self . log_history_storage_params . is_some ( ) {
2854
- Some ( self . log_history_storage_params . unwrap ( ) . try_into ( ) ?)
2855
- } else {
2856
- None
2857
- } ;
2857
+ let storage_params: Option < InnerStorageConfig > = if self . log_history_external_storage_on {
2858
+ Some ( self . log_history_storage_params . try_into ( ) ?)
2859
+ } else {
2860
+ None
2861
+ } ;
2858
2862
Ok ( InnerHistoryConfig {
2859
2863
on : self . log_history_on ,
2860
2864
log_only : self . log_history_log_only ,
@@ -2887,7 +2891,8 @@ impl From<InnerHistoryConfig> for HistoryLogConfig {
2887
2891
log_history_level : inner. level ,
2888
2892
log_history_retention_interval : inner. retention_interval ,
2889
2893
log_history_tables : inner. tables . into_iter ( ) . map ( Into :: into) . collect ( ) ,
2890
- log_history_storage_params : inner_storage_config. map ( Into :: into) ,
2894
+ log_history_external_storage_on : inner_storage_config. is_some ( ) ,
2895
+ log_history_storage_params : inner_storage_config. map ( Into :: into) . unwrap_or_default ( ) ,
2891
2896
}
2892
2897
}
2893
2898
}
0 commit comments