@@ -17,6 +17,7 @@ use std::{
17
17
use zenith_utils:: zid:: { ZTenantId , ZTimelineId } ;
18
18
19
19
use log:: * ;
20
+ use zenith_utils:: crashsafe_dir;
20
21
use zenith_utils:: logging;
21
22
use zenith_utils:: lsn:: Lsn ;
22
23
@@ -118,7 +119,7 @@ pub fn init_pageserver(conf: &'static PageServerConf, create_tenant: Option<&str
118
119
println ! ( "initializing tenantid {}" , tenantid) ;
119
120
create_repo ( conf, tenantid, dummy_redo_mgr) . with_context ( || "failed to create repo" ) ?;
120
121
}
121
- fs :: create_dir_all ( conf. tenants_path ( ) ) ?;
122
+ crashsafe_dir :: create_dir_all ( conf. tenants_path ( ) ) ?;
122
123
123
124
println ! ( "pageserver init succeeded" ) ;
124
125
Ok ( ( ) )
@@ -135,12 +136,12 @@ pub fn create_repo(
135
136
}
136
137
137
138
// top-level dir may exist if we are creating it through CLI
138
- fs :: create_dir_all ( & repo_dir)
139
+ crashsafe_dir :: create_dir_all ( & repo_dir)
139
140
. with_context ( || format ! ( "could not create directory {}" , repo_dir. display( ) ) ) ?;
140
141
141
- fs :: create_dir ( conf. timelines_path ( & tenantid) ) ?;
142
- fs :: create_dir_all ( conf. branches_path ( & tenantid) ) ?;
143
- fs :: create_dir_all ( conf. tags_path ( & tenantid) ) ?;
142
+ crashsafe_dir :: create_dir ( conf. timelines_path ( & tenantid) ) ?;
143
+ crashsafe_dir :: create_dir_all ( conf. branches_path ( & tenantid) ) ?;
144
+ crashsafe_dir :: create_dir_all ( conf. tags_path ( & tenantid) ) ?;
144
145
145
146
info ! ( "created directory structure in {}" , repo_dir. display( ) ) ;
146
147
0 commit comments