mirror of
https://github.com/neondatabase/neon.git
synced 2026-08-12 09:19:39 +00:00
tests: log hygiene checks for storage controller (#6710)
## Problem As with the pageserver, we should fail tests that emit unexpected log errors/warnings. ## Summary of changes - Refactor existing log checks to be reusable - Run log checks for attachment_service - Add allow lists as needed.
This commit is contained in:
@@ -7,7 +7,9 @@ use std::{
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
|
||||
use crate::{id_lock_map::IdLockMap, persistence::AbortShardSplitStatus};
|
||||
use crate::{
|
||||
id_lock_map::IdLockMap, persistence::AbortShardSplitStatus, reconciler::ReconcileError,
|
||||
};
|
||||
use anyhow::Context;
|
||||
use control_plane::storage_controller::{
|
||||
AttachHookRequest, AttachHookResponse, InspectRequest, InspectResponse,
|
||||
@@ -733,7 +735,19 @@ impl Service {
|
||||
tenant.waiter.advance(result.sequence);
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::warn!("Reconcile error: {}", e);
|
||||
match e {
|
||||
ReconcileError::Cancel => {
|
||||
tracing::info!("Reconciler was cancelled");
|
||||
}
|
||||
ReconcileError::Remote(mgmt_api::Error::Cancelled) => {
|
||||
// This might be due to the reconciler getting cancelled, or it might
|
||||
// be due to the `Node` being marked offline.
|
||||
tracing::info!("Reconciler cancelled during pageserver API call");
|
||||
}
|
||||
_ => {
|
||||
tracing::warn!("Reconcile error: {}", e);
|
||||
}
|
||||
}
|
||||
|
||||
// Ordering: populate last_error before advancing error_seq,
|
||||
// so that waiters will see the correct error after waiting.
|
||||
@@ -3631,6 +3645,13 @@ impl Service {
|
||||
observed_loc.conf = None;
|
||||
}
|
||||
|
||||
if new_nodes.len() == 1 {
|
||||
// Special case for single-node cluster: there is no point trying to reschedule
|
||||
// any tenant shards: avoid doing so, in order to avoid spewing warnings about
|
||||
// failures to schedule them.
|
||||
continue;
|
||||
}
|
||||
|
||||
if tenant_state.intent.demote_attached(node_id) {
|
||||
tenant_state.sequence = tenant_state.sequence.next();
|
||||
match tenant_state.schedule(scheduler) {
|
||||
|
||||
Reference in New Issue
Block a user