@@ -46,8 +46,8 @@ usage(void)
46
46
{
47
47
static const char * options [] = {"-B" , "maintain release 3.3 log file compatibility" ,
48
48
"-C config" , "wiredtiger_open configuration" , "-E key" , "secret encryption key" , "-h home" ,
49
- "database directory" , "-L" , "turn logging off for debug-mode" , "-m" , "run verify on metadata " ,
50
- "-p" ,
49
+ "database directory" , "-L" , "turn logging off for debug-mode" , "-l " ,
50
+ "run live restore using the path specified." , "-m" , "run verify on metadata" , " -p" ,
51
51
"disable pre-fetching on the connection (use this option when dumping/verifying corrupted "
52
52
"data)" ,
53
53
"-R" , "run recovery (if recovery configured)" , "-r" ,
@@ -83,8 +83,8 @@ main(int argc, char *argv[])
83
83
size_t len ;
84
84
int ch , major_v , minor_v , tret , (* func )(WT_SESSION * , int , char * []);
85
85
char * p , * secretkey ;
86
- const char * cmd_config , * conn_config , * p1 , * p2 , * p3 , * readonly_config , * rec_config ,
87
- * salvage_config , * session_config ;
86
+ const char * cmd_config , * conn_config , * live_restore_path , * p1 , * p2 , * p3 , * readonly_config ,
87
+ * rec_config , * salvage_config , * session_config ;
88
88
bool backward_compatible , disable_prefetch , logoff , meta_verify , readonly , recover , salvage ;
89
89
90
90
conn = NULL ;
@@ -106,7 +106,8 @@ main(int argc, char *argv[])
106
106
return (EXIT_FAILURE );
107
107
}
108
108
109
- cmd_config = conn_config = readonly_config = salvage_config = session_config = secretkey = NULL ;
109
+ cmd_config = conn_config = live_restore_path = readonly_config = salvage_config =
110
+ session_config = secretkey = NULL ;
110
111
/*
111
112
* We default to returning an error if recovery needs to be run. Generally we expect this to be
112
113
* run after a clean shutdown. The printlog command disables logging entirely. If recovery is
@@ -117,7 +118,7 @@ main(int argc, char *argv[])
117
118
false;
118
119
/* Check for standard options. */
119
120
__wt_optwt = 1 ; /* enable WT-specific behavior */
120
- while ((ch = __wt_getopt (progname , argc , argv , "BC:E:h:LmpRrSVv?" )) != EOF )
121
+ while ((ch = __wt_getopt (progname , argc , argv , "BC:E:h:l: LmpRrSVv?" )) != EOF )
121
122
switch (ch ) {
122
123
case 'B' : /* backward compatibility */
123
124
backward_compatible = true;
@@ -142,6 +143,9 @@ main(int argc, char *argv[])
142
143
rec_config = REC_LOGOFF ;
143
144
logoff = true;
144
145
break ;
146
+ case 'l' :
147
+ live_restore_path = __wt_optarg ;
148
+ break ;
145
149
case 'm' : /* verify metadata on connection open */
146
150
cmd_config = "verify_metadata=true" ;
147
151
meta_verify = true;
@@ -290,6 +294,11 @@ main(int argc, char *argv[])
290
294
len += strlen (conn_config );
291
295
if (cmd_config != NULL )
292
296
len += strlen (cmd_config );
297
+ len += strlen ("live_restore=(enabled=,threads_max=0,path=)" );
298
+ if (live_restore_path != NULL )
299
+ len += strlen (live_restore_path ) + strlen ("true" );
300
+ else
301
+ len += strlen ("false" );
293
302
if (readonly_config != NULL )
294
303
len += strlen (readonly_config );
295
304
if (salvage_config != NULL )
@@ -305,8 +314,11 @@ main(int argc, char *argv[])
305
314
(void )util_err (NULL , errno , NULL );
306
315
goto err ;
307
316
}
308
- if ((ret = __wt_snprintf (p , len , "error_prefix=wt,%s,%s,%s,%s,%s%s%s%s" ,
317
+ if ((ret = __wt_snprintf (p , len ,
318
+ "error_prefix=wt,%s,%s,live_restore=(enabled=%s,threads_max=0,path=%s),%s,%s,%s%s%s%s" ,
309
319
conn_config == NULL ? "" : conn_config , cmd_config == NULL ? "" : cmd_config ,
320
+ live_restore_path == NULL ? "false" : "true" ,
321
+ live_restore_path == NULL ? "" : live_restore_path ,
310
322
readonly_config == NULL ? "" : readonly_config , rec_config ,
311
323
salvage_config == NULL ? "" : salvage_config , p1 , p2 , p3 )) != 0 ) {
312
324
(void )util_err (NULL , ret , NULL );
0 commit comments