@@ -366,19 +366,7 @@ Status ArrayDirectory::load() {
366366
367367 // Load (in parallel) the array metadata URIs
368368 tasks.emplace_back (resources_.get ().compute_tp ().execute ([&]() {
369- int delay = 250 , max_retries = 25 ;
370- for (int retry = 0 ; retry <= max_retries; ++retry) {
371- if (load_array_meta_uris ()) {
372- break ;
373- }
374- // Retry is triggered if metadata files were still flushing to disk.
375- std::this_thread::sleep_for (std::chrono::milliseconds (delay));
376- resources_.get ().logger ()->info (
377- " Encountered partially written array metadata while opening the "
378- " array. Waiting {}ms and retrying." , delay);
379- // Apply (default REST) backoff and retry up to 25 times.
380- delay *= 1.25 ;
381- }
369+ load_array_meta_uris ();
382370 return Status::Ok ();
383371 }));
384372 }
@@ -606,7 +594,7 @@ std::vector<URI> ArrayDirectory::ls(const URI& uri) const {
606594 std::vector<URI> uris;
607595 uris.reserve (dir_entries.size ());
608596
609- for (auto entry : dir_entries) {
597+ for (const auto & entry : dir_entries) {
610598 auto entry_uri = URI (entry.path ().native ());
611599
612600 // Always list directories
@@ -844,17 +832,20 @@ ArrayDirectory::load_consolidated_commit_uris(
844832 return {Status::Ok (), uris, uris_set};
845833}
846834
847- bool ArrayDirectory::load_array_meta_uris () {
835+ void ArrayDirectory::load_array_meta_uris () {
848836 // Load the URIs in the array metadata directory
849837 std::vector<URI> array_meta_dir_uris;
850838 {
851839 auto timer_se = stats_->start_timer (" list_array_meta_uris" );
852- array_meta_dir_uris =
853- ls (uri_.join_path (constants::array_metadata_dir_name));
854- }
855- auto pred = [](const URI& uri) { return uri.to_string ().ends_with (" .tmp" ); };
856- if (uri_.is_file () && std::ranges::any_of (array_meta_dir_uris, pred)) {
857- return false ;
840+ std::vector<URI> unfiltered_uris;
841+ throw_if_not_ok (resources_.get ().vfs ().ls (
842+ uri_.join_path (constants::array_metadata_dir_name), &unfiltered_uris));
843+ for (const auto & unfiltered_uri : unfiltered_uris) {
844+ const auto & uri = unfiltered_uri.to_string ();
845+ if (!uri.ends_with (constants::temp_file_suffix)) {
846+ array_meta_dir_uris.emplace_back (uri);
847+ }
848+ }
858849 }
859850
860851 // Compute array metadata URIs and vacuum URIs to vacuum. */
@@ -871,7 +862,6 @@ bool ArrayDirectory::load_array_meta_uris() {
871862 throw_if_not_ok (st2);
872863 array_meta_uris_ = std::move (array_meta_filtered_uris.value ());
873864 array_meta_dir_uris.clear ();
874- return true ;
875865}
876866
877867void ArrayDirectory::load_array_schema_uris () {
0 commit comments