File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
router/src/metadata_cache/src Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -1395,17 +1395,19 @@ static std::optional<size_t> target_cluster_pos(
1395
1395
1396
1396
std::optional<metadata_cache::metadata_server_t >
1397
1397
GRClusterSetMetadataBackend::find_rw_server () {
1398
- for (auto &cluster : (*cluster_topology_).clusters_data ) {
1399
- if (!cluster.is_primary ) continue ;
1398
+ if (cluster_topology_) {
1399
+ for (auto &cluster : (*cluster_topology_).clusters_data ) {
1400
+ if (!cluster.is_primary ) continue ;
1400
1401
1401
- log_debug (" Updating the status of cluster '%s' to find the writable node" ,
1402
- cluster.name .c_str ());
1402
+ log_debug (" Updating the status of cluster '%s' to find the writable node" ,
1403
+ cluster.name .c_str ());
1403
1404
1404
- // we need to connect to the Primary Cluster and query its GR status to
1405
- // figure out the current Primary node
1406
- metadata_->update_cluster_status_from_gr (false , cluster);
1405
+ // we need to connect to the Primary Cluster and query its GR status to
1406
+ // figure out the current Primary node
1407
+ metadata_->update_cluster_status_from_gr (false , cluster);
1407
1408
1408
- return metadata_->find_rw_server (cluster.members );
1409
+ return metadata_->find_rw_server (cluster.members );
1410
+ }
1409
1411
}
1410
1412
1411
1413
return std::nullopt;
You can’t perform that action at this time.
0 commit comments