Skip to content

Commit

Permalink
storcon_cli: do not drain to undesirable nodes (#8027)
Browse files Browse the repository at this point in the history
## Problem
The previous code would attempt to drain to unavailable or unschedulable
nodes.

## Summary of Changes
Remove such nodes from the list of nodes to fill.
  • Loading branch information
VladLazar committed Jun 12, 2024
1 parent f749437 commit 3099e1a
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions control_plane/storcon_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -786,18 +786,15 @@ async fn main() -> anyhow::Result<()> {
anyhow::bail!("Drain requested for node which doesn't exist.")
}

let can_fill = node_to_fill_descs
.iter()
.filter(|desc| {
matches!(desc.availability, NodeAvailabilityWrapper::Active)
&& matches!(
desc.scheduling,
NodeSchedulingPolicy::Active | NodeSchedulingPolicy::Filling
)
})
.any(|_| true);
node_to_fill_descs.retain(|desc| {
matches!(desc.availability, NodeAvailabilityWrapper::Active)
&& matches!(
desc.scheduling,
NodeSchedulingPolicy::Active | NodeSchedulingPolicy::Filling
)
});

if !can_fill {
if node_to_fill_descs.is_empty() {
anyhow::bail!("There are no nodes to drain to")
}

Expand Down

1 comment on commit 3099e1a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3298 tests run: 3142 passed, 1 failed, 155 skipped (full report)


Failures on Postgres 14

  • test_basebackup_with_high_slru_count[github-actions-selfhosted-sequential-10-13-30]: release
# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_basebackup_with_high_slru_count[release-pg14-github-actions-selfhosted-sequential-10-13-30]"
Flaky tests (2)

Postgres 15

  • test_vm_bit_clear_on_heap_lock_blackbox: debug

Postgres 14

  • test_storage_controller_smoke: debug

Code coverage* (full report)

  • functions: 31.6% (6633 of 20989 functions)
  • lines: 48.6% (51505 of 106042 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
3099e1a at 2024-06-12T12:55:43.428Z :recycle:

Please sign in to comment.