@@ -98,6 +98,8 @@ pub struct OpenRegion {
98
98
pub region_options : HashMap < String , String > ,
99
99
#[ serde( default ) ]
100
100
pub region_wal_options : HashMap < String , String > ,
101
+ #[ serde( default ) ]
102
+ pub skip_wal_replay : bool ,
101
103
}
102
104
103
105
impl OpenRegion {
@@ -106,12 +108,14 @@ impl OpenRegion {
106
108
path : & str ,
107
109
region_options : HashMap < String , String > ,
108
110
region_wal_options : HashMap < String , String > ,
111
+ skip_wal_replay : bool ,
109
112
) -> Self {
110
113
Self {
111
114
region_ident,
112
115
region_storage_path : path. to_string ( ) ,
113
116
region_options,
114
117
region_wal_options,
118
+ skip_wal_replay,
115
119
}
116
120
}
117
121
}
@@ -227,12 +231,13 @@ mod tests {
227
231
"test/foo" ,
228
232
HashMap :: new ( ) ,
229
233
HashMap :: new ( ) ,
234
+ false ,
230
235
) ) ;
231
236
232
237
let serialized = serde_json:: to_string ( & open_region) . unwrap ( ) ;
233
238
234
239
assert_eq ! (
235
- r#"{"OpenRegion":{"region_ident":{"cluster_id":1,"datanode_id":2,"table_id":1024,"region_number":1,"engine":"mito2"},"region_storage_path":"test/foo","region_options":{},"region_wal_options":{}}}"# ,
240
+ r#"{"OpenRegion":{"region_ident":{"cluster_id":1,"datanode_id":2,"table_id":1024,"region_number":1,"engine":"mito2"},"region_storage_path":"test/foo","region_options":{},"region_wal_options":{},"skip_wal_replay":false }}"# ,
236
241
serialized
237
242
) ;
238
243
@@ -289,6 +294,7 @@ mod tests {
289
294
region_storage_path,
290
295
region_options,
291
296
region_wal_options : HashMap :: new ( ) ,
297
+ skip_wal_replay : false ,
292
298
} ;
293
299
assert_eq ! ( expected, deserialized) ;
294
300
}
0 commit comments