test: Ask ingesters to persist before asking catalog for their partition keys

pull/24376/head
Carol (Nichols || Goulding) 2023-08-18 09:21:35 -04:00
parent a566cda344
commit 1d6366d2f4
No known key found for this signature in database
GPG Key ID: E907EE5A736F87D4
2 changed files with 15 additions and 5 deletions

View File

@ -563,16 +563,20 @@ impl MiniCluster {
Ok(IngesterResponse { partitions })
}
/// Ask all of the ingesters to persist their data.
/// Ask all of the ingesters to persist their data for the cluster namespace.
pub async fn persist_ingesters(&self) {
self.persist_ingesters_by_namespace(None).await;
}
/// Ask all of the ingesters to persist their data for a specified namespace, or the cluster
/// namespace if none specified.
pub async fn persist_ingesters_by_namespace(&self, namespace: Option<String>) {
let namespace = namespace.unwrap_or_else(|| self.namespace().into());
for ingester in &self.ingesters {
let mut ingester_client =
influxdb_iox_client::ingester::Client::new(ingester.ingester_grpc_connection());
ingester_client
.persist(self.namespace().into())
.await
.unwrap();
ingester_client.persist(namespace.clone()).await.unwrap();
}
}

View File

@ -606,6 +606,12 @@ where
namespace_name,
expected,
} => {
info!("====Persist ingesters to ensure catalog partition records exist");
state
.cluster()
.persist_ingesters_by_namespace(namespace_name.clone())
.await;
info!("====Begin reading partition keys for table: {}", table_name);
let partition_keys = state
.cluster()