File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
rust/cubestore/cubestore/src/metastore Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,12 @@ impl BaseRocksStoreFs {
145
145
name : & str ,
146
146
) -> Result < HashMap < u128 , Vec < String > > , CubeError > {
147
147
let existing_metastore_files = remote_fs. list ( format ! ( "{}-" , name) ) . await ?;
148
+ // Log a debug statement so that we can rule out the filename list itself being too large for memory.
149
+ log:: debug!(
150
+ "Listed existing {} files, count = {}" ,
151
+ name,
152
+ existing_metastore_files. len( )
153
+ ) ;
148
154
let mut snapshot_map = HashMap :: < u128 , Vec < String > > :: new ( ) ;
149
155
for existing in existing_metastore_files. into_iter ( ) {
150
156
let path = existing. split ( "/" ) . nth ( 0 ) . map ( |p| {
@@ -197,10 +203,15 @@ impl BaseRocksStoreFs {
197
203
return Ok ( vec ! [ ] ) ;
198
204
}
199
205
200
- let mut to_delete = Vec :: new ( ) ;
206
+ let mut to_delete: Vec < String > = Vec :: new ( ) ;
201
207
208
+ let mut candidates_map = candidates_map;
202
209
for ms in snapshots_list {
203
- to_delete. extend_from_slice ( & candidates_map[ & ms] ) ;
210
+ to_delete. append (
211
+ candidates_map
212
+ . get_mut ( & ms)
213
+ . expect ( "delete_old_snapshots candidates_map lookup should succeed" ) ,
214
+ ) ;
204
215
}
205
216
206
217
for batch in to_delete. chunks (
You can’t perform that action at this time.
0 commit comments