From bf9eafd6201461cc9fe7676440ab5b679a912ad0 Mon Sep 17 00:00:00 2001 From: Siddharth Shah Date: Thu, 7 Mar 2024 03:38:32 +0530 Subject: [PATCH] [#20967] CDCSDK: Fix testPgRegressReplicationSlot & TestReplicationSlotDropWithActiveInvalid Summary: In my recently landed change ([[ https://phorge.dev.yugabyte.com/D32470 | https://phorge.dev.yugabyte.com/D32470 ]]/ commit 1a36386908658ddc9cbbb9f9f84a09c33377f618), I changed the flag that guarded the addition of slot's entry in cdc_state table due to which some tests started failing. Earlier the flag used was `FLAGS_ysql_yb_enable_replication_commands` but since this flag was added to guard CRUD related changes, I replaced it with `FLAGS_ysql_TEST_enable_replication_slot_consumption` which is protecting changes related to the new consumption model of CDC. Jira: DB-9942 Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressReplicationSlot#testPgRegressReplicationSlot' /yb_build.sh --cxx-test integration-tests_cdcsdk_ysql-test --gtest_filter CDCSDKYsqlTest.TestReplicationSlotDropWithActiveInvalid Reviewers: stiwary Reviewed By: stiwary Subscribers: ycdcxcluster, jason Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D32925 --- .../test/java/org/yb/pgsql/TestPgRegressReplicationSlot.java | 2 ++ src/yb/integration-tests/cdcsdk_ysql-test.cc | 1 + 2 files changed, 3 insertions(+) diff --git a/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgRegressReplicationSlot.java b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgRegressReplicationSlot.java index f530b46dbc50..c680949c3876 100644 --- a/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgRegressReplicationSlot.java +++ b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgRegressReplicationSlot.java @@ -35,6 +35,7 @@ protected Map getTServerFlags() { "ysql_yb_enable_replication_commands,yb_enable_cdc_consistent_snapshot_streams"); flagMap.put("ysql_yb_enable_replication_commands", "true"); flagMap.put("yb_enable_cdc_consistent_snapshot_streams", "true"); + flagMap.put("ysql_TEST_enable_replication_slot_consumption", "true"); return flagMap; } @@ -45,6 +46,7 @@ protected Map getMasterFlags() { "ysql_yb_enable_replication_commands,yb_enable_cdc_consistent_snapshot_streams"); flagMap.put("ysql_yb_enable_replication_commands", "true"); flagMap.put("yb_enable_cdc_consistent_snapshot_streams", "true"); + flagMap.put("ysql_TEST_enable_replication_slot_consumption", "true"); return flagMap; } diff --git a/src/yb/integration-tests/cdcsdk_ysql-test.cc b/src/yb/integration-tests/cdcsdk_ysql-test.cc index f3dddedbf9ea..a3e33fd187b1 100644 --- a/src/yb/integration-tests/cdcsdk_ysql-test.cc +++ b/src/yb/integration-tests/cdcsdk_ysql-test.cc @@ -7666,6 +7666,7 @@ TEST_F(CDCSDKYsqlTest, TestReplicationSlotDropWithActiveInvalid) { ANNOTATE_UNPROTECTED_WRITE(FLAGS_ysql_cdc_active_replication_slot_window_ms) = 10000 * yb::kTimeMultiplier; ANNOTATE_UNPROTECTED_WRITE(FLAGS_yb_enable_cdc_consistent_snapshot_streams) = true; + ANNOTATE_UNPROTECTED_WRITE(FLAGS_ysql_TEST_enable_replication_slot_consumption) = true; ASSERT_OK(SetUpWithParams(3, 1, false)); auto table =