Skip to content

Commit

Permalink
[#20421] xCluster: Fix SysXClusterOutboundReplicationGroupEntryPB::Na…
Browse files Browse the repository at this point in the history
…mespaceInfoPB name

Summary:
All PB messages must have PB suffix.

**Upgrade/Rollback safety:**
This PB is not yet in use. It is guarded under gflag `TEST_enable_xcluster_api_v2`

Jira: DB-9414

Test Plan: Jenkins

Reviewers: jhe, xCluster

Reviewed By: jhe

Subscribers: ybase, bogdan

Differential Revision: https://phorge.dev.yugabyte.com/D32880
  • Loading branch information
hari90 committed Mar 6, 2024
1 parent 7a4705d commit ef7cc0c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/yb/master/catalog_entity_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ message SysXClusterOutboundReplicationGroupEntryPB {
// Namespace Id -> NamespaceInfoPB
map<string, NamespaceInfoPB> namespace_infos = 1;

message TargetUniverseInfo {
message TargetUniverseInfoPB {
required bytes universe_uuid = 1;

enum State {
Expand All @@ -834,7 +834,7 @@ message SysXClusterOutboundReplicationGroupEntryPB {
optional AppStatusPB error_status = 3; // Set when status is FAILED
}

optional TargetUniverseInfo target_universe_info = 2;
optional TargetUniverseInfoPB target_universe_info = 2;

enum State {
READY = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ TEST_F(XClusterOutboundReplicationGroupMockedTest, CreateTargetReplicationGroup)
ASSERT_EQ(pb.target_universe_info().universe_uuid(), kTargetUniverseUuid.ToString());
ASSERT_EQ(
pb.target_universe_info().state(),
SysXClusterOutboundReplicationGroupEntryPB::TargetUniverseInfo::CREATING_REPLICATION_GROUP);
SysXClusterOutboundReplicationGroupEntryPB::TargetUniverseInfoPB::CREATING_REPLICATION_GROUP);

EXPECT_CALL(*remote_client, IsSetupUniverseReplicationDone(_))
.WillOnce(Return(IsOperationDoneResult::Done(STATUS(IllegalState, error_str))));
Expand Down Expand Up @@ -480,7 +480,7 @@ TEST_F(XClusterOutboundReplicationGroupMockedTest, CreateTargetReplicationGroup)
ASSERT_EQ(pb.target_universe_info().universe_uuid(), kTargetUniverseUuid.ToString());
ASSERT_EQ(
pb.target_universe_info().state(),
SysXClusterOutboundReplicationGroupEntryPB::TargetUniverseInfo::REPLICATING);
SysXClusterOutboundReplicationGroupEntryPB::TargetUniverseInfoPB::REPLICATING);
}

TEST_F(XClusterOutboundReplicationGroupMockedTest, AddTable) {
Expand Down
9 changes: 4 additions & 5 deletions src/yb/master/xcluster/xcluster_outbound_replication_group.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "yb/client/xcluster_client.h"
#include "yb/master/catalog_entity_info.h"
#include "yb/master/xcluster/xcluster_outbound_replication_group_tasks.h"
#include "yb/master/xcluster_rpc_tasks.h"
#include "yb/util/is_operation_done_result.h"
#include "yb/util/status_log.h"

Expand Down Expand Up @@ -570,7 +569,7 @@ Status XClusterOutboundReplicationGroup::CreateXClusterReplication(

target_universe_info->set_universe_uuid(target_uuid.ToString());
target_universe_info->set_state(
SysXClusterOutboundReplicationGroupEntryPB::TargetUniverseInfo::CREATING_REPLICATION_GROUP);
SysXClusterOutboundReplicationGroupEntryPB::TargetUniverseInfoPB::CREATING_REPLICATION_GROUP);

RETURN_NOT_OK(Upsert(l, epoch));

Expand All @@ -590,13 +589,13 @@ Result<IsOperationDoneResult> XClusterOutboundReplicationGroup::IsCreateXCluster
auto& target_universe = *outbound_group.mutable_target_universe_info();

if (target_universe.state() ==
SysXClusterOutboundReplicationGroupEntryPB::TargetUniverseInfo::REPLICATING) {
SysXClusterOutboundReplicationGroupEntryPB::TargetUniverseInfoPB::REPLICATING) {
return IsOperationDoneResult::Done();
}

auto setup_result = IsOperationDoneResult::NotDone();
if (target_universe.state() ==
SysXClusterOutboundReplicationGroupEntryPB_TargetUniverseInfo::FAILED) {
SysXClusterOutboundReplicationGroupEntryPB_TargetUniverseInfoPB::FAILED) {
Status status;
if (target_universe.has_error_status()) {
status = StatusFromPB(target_universe.error_status());
Expand All @@ -620,7 +619,7 @@ Result<IsOperationDoneResult> XClusterOutboundReplicationGroup::IsCreateXCluster

if (setup_result.status().ok()) {
target_universe.set_state(
SysXClusterOutboundReplicationGroupEntryPB::TargetUniverseInfo::REPLICATING);
SysXClusterOutboundReplicationGroupEntryPB::TargetUniverseInfoPB::REPLICATING);
} else {
LOG_WITH_PREFIX(WARNING) << "Failed to create replication group on target cluster: "
<< setup_result.status();
Expand Down

0 comments on commit ef7cc0c

Please sign in to comment.