Skip to content

Commit

Permalink
861 alien allocation (#864)
Browse files Browse the repository at this point in the history
* 861 remove allocation in most cases

* 861 update changelog
  • Loading branch information
idruzhitskiy authored Jan 26, 2024
1 parent 5e5411b commit 31cc454
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Bob versions changelog
- Save gRPC error when parsing status (#842)
- Increased number and max delay of retries for Bob state checking in integration tests (#856)
- Update writing logic for aliens integration tests to capture lost records problem (#851)
- Remove allocation on alien exist (#861)

#### Fixed
- Fix missing alien records due to multiple groups (#806)
Expand Down
13 changes: 8 additions & 5 deletions bob-backend/src/pearl/disk_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,18 +519,21 @@ impl DiskController {
keys: &[BobKey],
) -> Result<Vec<bool>, Error> {
if *self.state.read().await == GroupsState::Ready {
let mut result = vec![false; keys.len()];
let mut result: Option<Vec<bool>> = None;
for g in self.find_all_groups(&op).await {
match g.exist(keys).await {
Ok(r) => {
for i in 0..r.len() {
result[i] |= r[i];
}
result = result.map(|mut result| {
for i in 0..r.len() {
result[i] |= r[i];
}
result
}).or(Some(r));
},
Err(e) => debug!("error getting exist results for op {:?}: {:?}", op, e),
}
}
Ok(result)
Ok(result.unwrap_or_else(|| vec![false; keys.len()]))
} else {
Err(Error::dc_is_not_available())
}
Expand Down

0 comments on commit 31cc454

Please sign in to comment.