Skip to content

Commit

Permalink
cluster/session: replace QueryError with MetadataError in refresh path
Browse files Browse the repository at this point in the history
  • Loading branch information
muzarski committed Jan 16, 2025
1 parent a7041ce commit 3e1aa4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions scylla/src/client/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ use crate::cluster::node::CloudEndpoint;
use crate::cluster::node::{InternalKnownNode, KnownNode, NodeRef};
use crate::cluster::{Cluster, ClusterNeatDebug, ClusterState};
use crate::errors::{
BadQuery, NewSessionError, ProtocolError, QueryError, RequestAttemptError, RequestError,
TracingProtocolError,
BadQuery, MetadataError, NewSessionError, ProtocolError, QueryError, RequestAttemptError,
RequestError, TracingProtocolError,
};
use crate::frame::response::result;
#[cfg(feature = "ssl")]
Expand Down Expand Up @@ -1710,7 +1710,7 @@ where
///
/// Normally this is not needed,
/// the driver should automatically detect all metadata changes in the cluster
pub async fn refresh_metadata(&self) -> Result<(), QueryError> {
pub async fn refresh_metadata(&self) -> Result<(), MetadataError> {
self.cluster.refresh_metadata().await
}

Expand Down
8 changes: 4 additions & 4 deletions scylla/src/cluster/worker.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::client::session::TABLET_CHANNEL_SIZE;
use crate::errors::{NewSessionError, QueryError};
use crate::errors::{MetadataError, NewSessionError, QueryError};
use crate::frame::response::event::{Event, StatusChangeEvent};
use crate::network::{PoolConfig, VerifiedKeyspaceName};
use crate::policies::host_filter::HostFilter;
Expand Down Expand Up @@ -95,7 +95,7 @@ struct ClusterWorker {

#[derive(Debug)]
struct RefreshRequest {
response_chan: tokio::sync::oneshot::Sender<Result<(), QueryError>>,
response_chan: tokio::sync::oneshot::Sender<Result<(), MetadataError>>,
}

#[derive(Debug)]
Expand Down Expand Up @@ -181,7 +181,7 @@ impl Cluster {
self.data.load_full()
}

pub(crate) async fn refresh_metadata(&self) -> Result<(), QueryError> {
pub(crate) async fn refresh_metadata(&self) -> Result<(), MetadataError> {
let (response_sender, response_receiver) = tokio::sync::oneshot::channel();

self.refresh_channel
Expand Down Expand Up @@ -400,7 +400,7 @@ impl ClusterWorker {
use_keyspace_result(use_keyspace_results.into_iter())
}

async fn perform_refresh(&mut self) -> Result<(), QueryError> {
async fn perform_refresh(&mut self) -> Result<(), MetadataError> {
// Read latest Metadata
let metadata = self.metadata_reader.read_metadata(false).await?;
let cluster_data: Arc<ClusterState> = self.cluster_data.load_full();
Expand Down

0 comments on commit 3e1aa4e

Please sign in to comment.