Skip to content

Commit

Permalink
Add comments on returning Status::Ok() with nullopt (#3217)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shelnutt2 authored Aug 16, 2022
1 parent 7cb2ad1 commit 21faaba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tiledb/sm/storage_manager/storage_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2089,6 +2089,8 @@ tuple<Status, optional<shared_ptr<Group>>> StorageManager::load_group_details(
auto timer_se = stats_->start_timer("sm_load_group_details");
const URI& latest_group_uri = group_directory->latest_group_details_uri();
if (latest_group_uri.is_invalid()) {
// Returning ok because not having the latest group details means the group
// has just been created and no members have been added yet.
return {Status::Ok(), std::nullopt};
}
return load_group_from_uri(
Expand All @@ -2115,6 +2117,8 @@ StorageManager::group_open_for_reads(Group* group) {
return {Status::Ok(), group_deserialized.value()->members()};
}

// Return ok because having no members is acceptable if the group has never
// been written to.
return {Status::Ok(), std::nullopt};
}

Expand All @@ -2138,6 +2142,8 @@ StorageManager::group_open_for_writes(Group* group) {
return {Status::Ok(), group_deserialized.value()->members()};
}

// Return ok because having no members is acceptable if the group has never
// been written to.
return {Status::Ok(), std::nullopt};
}

Expand Down

0 comments on commit 21faaba

Please sign in to comment.