Skip to content

Commit

Permalink
Do not use read-ahead cache in array/group directory.
Browse files Browse the repository at this point in the history
In all cases where we read files from the VFS there, we get the file's size beforehand and read the entirety of it. This makes the read-ahead cache not actually required.
Fixes failures when reading empty `.vac` files.
  • Loading branch information
teo-tsirpanis committed Feb 13, 2025
1 parent d8bbb8b commit 7f6f492
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tiledb/sm/array/array_directory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ ArrayDirectory::load_consolidated_commit_uris(
std::string names;
names.resize(size);
RETURN_NOT_OK_TUPLE(
resources_.get().vfs().read(uri, 0, &names[0], size),
resources_.get().vfs().read(uri, 0, &names[0], size, false),
nullopt,
nullopt);
std::stringstream ss(names);
Expand All @@ -752,7 +752,7 @@ ArrayDirectory::load_consolidated_commit_uris(
auto& names = meta_files.back().second;
names.resize(size);
RETURN_NOT_OK_TUPLE(
resources_.get().vfs().read(uri, 0, &names[0], size),
resources_.get().vfs().read(uri, 0, &names[0], size, false),
nullopt,
nullopt);
std::stringstream ss(names);
Expand Down Expand Up @@ -1082,7 +1082,7 @@ ArrayDirectory::compute_uris_to_vacuum(
throw_if_not_ok(vfs.file_size(vac_files[i], &size));
std::string names;
names.resize(size);
throw_if_not_ok(vfs.read(vac_files[i], 0, &names[0], size));
throw_if_not_ok(vfs.read(vac_files[i], 0, &names[0], size, false));
std::stringstream ss(names);
bool vacuum_vac_file = true;
for (std::string uri_str; std::getline(ss, uri_str);) {
Expand Down
2 changes: 1 addition & 1 deletion tiledb/sm/group/group_directory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ GroupDirectory::compute_uris_to_vacuum(const std::vector<URI>& uris) const {
throw_if_not_ok(vfs_.file_size(vac_files[i], &size));
std::string names;
names.resize(size);
throw_if_not_ok(vfs_.read(vac_files[i], 0, &names[0], size));
throw_if_not_ok(vfs_.read(vac_files[i], 0, &names[0], size, false));
std::stringstream ss(names);
bool vacuum_vac_file = true;
for (std::string uri_str; std::getline(ss, uri_str);) {
Expand Down

0 comments on commit 7f6f492

Please sign in to comment.