Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pgtap subtree merge #4

Open
wants to merge 1,232 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
1232 commits
Select commit Hold shift + click to select a range
ec2c823
Clarify use of :schema testing extensions.
theory Nov 5, 2017
36a77cb
Make the test target .PHONY.
theory Nov 5, 2017
eb21ab7
Recognize partitioned tables.
theory Nov 5, 2017
7d67ff2
Add is_partitioned().
theory Nov 6, 2017
e18fd14
Make tests work with and without partitions.
theory Nov 6, 2017
12865ba
Fix 9.0 patch.
theory Nov 6, 2017
9b6994a
Sketch out is_partition_of().
theory Nov 6, 2017
c1a40f9
Test is_partition_of().
theory Nov 6, 2017
fa2cfda
Document is_partition_of.
theory Nov 6, 2017
b5fa9b6
Sketch out partitions_are().
theory Nov 6, 2017
9c72811
Tweak Changes.
theory Nov 6, 2017
fdf582b
Test partitions_are().
theory Nov 6, 2017
36cef74
Document partitions_are().
theory Nov 6, 2017
93c872a
Note use of regclass.
theory Nov 6, 2017
e37367b
Add partitions_are() to upgrade script.
theory Nov 6, 2017
8515fd5
Restore 9.6 compat.
theory Nov 6, 2017
47d7179
Add patch for 0.98 upgrade.
theory Nov 6, 2017
87c3a3d
Merge partition testing support.
theory Nov 6, 2017
60755c6
Add the materialized view functions to the v0.95.0 upgrade script.
theory Nov 6, 2017
9cd80f3
Patch for core and schema only once.
theory Nov 6, 2017
31cac42
Set DATA before loading PGXS.
theory Nov 6, 2017
9b5195a
Update compat patches.
theory Nov 6, 2017
56fe3ad
Fix throwtap test on 8.1.
theory Nov 6, 2017
d4b9f00
Fix diagnostic test indentation for 9.5.
theory Nov 6, 2017
d1277d7
trivial fix of typo: bar to bare
jmarca Nov 6, 2017
d989894
Tweak RPM spec file.
theory Nov 6, 2017
22e65a4
Note 9.6 compat changes.
theory Nov 6, 2017
3e7b57a
Timestamp v0.98.0.
theory Nov 6, 2017
1a68a2c
Do not archive .travis.yml
theory Nov 6, 2017
d8ffb6b
Increment to v0.99.0.
theory Nov 6, 2017
c1b0dd3
Add release-making notes.
theory Nov 6, 2017
0199dc2
Regular markdown, notnhing special.
theory Nov 6, 2017
0c31b33
Update copyright; fix m-dashes.
theory Nov 8, 2017
7d2a20e
Update introductory documentation.
theory Nov 8, 2017
eb27605
Spellcheck.
theory Nov 8, 2017
1374245
Add tips and tricks to the docs.
theory Nov 8, 2017
a5dd26f
Make pg_version_num() consistent with sever_version_num.
theory Nov 13, 2017
5b015b5
Credit Christoph.
theory Nov 13, 2017
2ede30f
Documentation typo fix (is/isnt functions description)
denied404 Jan 21, 2018
57c6cb2
Update mail list URL.
theory Mar 26, 2018
e633b44
Sort extras and missing.
theory Mar 27, 2018
ba2236c
Update 9.6 patch.
theory Mar 27, 2018
112fdee
Add missing BEING/END to PL/pgSQL function.
theory Apr 2, 2018
49b2efa
Use pg_index to see if a table has a primary key.
theory Jul 26, 2018
081fe1a
Note fix for bug #174.
theory Jul 26, 2018
e7f7686
Adjust patch offsets.
theory Jul 26, 2018
15858e2
Use pg_proc.prokind on Postgres 11.
theory Jul 28, 2018
4f7bbcf
Fix failing Postgres 11 test with bare RECORD argument.
theory Jul 28, 2018
f9fdfe8
Remove 8.0-specific tests.
theory Jul 28, 2018
da005fb
Properly apply v9.6 patch.
theory Jul 28, 2018
a8c7400
Match versions at start of string.
theory Aug 30, 2018
b50c634
Fix 'has_function' documentation error.
TobiasBengtsson Sep 4, 2018
dd76816
Omit failing tests from `make test`.
theory Sep 16, 2018
f415187
Don't require primary key in _hasc().
theory Sep 16, 2018
c5474ee
Tweak docs.
theory Sep 16, 2018
5649543
Update dates.
theory Sep 16, 2018
d2f3476
Timestamp v0.99.0.
theory Sep 16, 2018
3ed6d52
Increment to v0.99.1.
theory Sep 16, 2018
2d3e07e
Fix documentation. (#166)
dianhenglau Sep 16, 2018
0f2d0f5
Fix tocgen for Linux
marco44 Sep 16, 2018
267081f
Fix bugs and merge PRs before release.
theory Sep 16, 2018
0247546
fix: generation of uninstall script
pau4o Oct 16, 2018
e1e1191
Note fix from @pau4o #181.
theory Oct 17, 2018
651f95c
Test on Postgres 11.
theory Oct 31, 2018
2682ab6
Add `policies_are()`
pau4o Nov 5, 2018
7493f7d
Add documentation for `policies_are()`
pau4o Nov 5, 2018
318d4a8
Add tests for `policies_are()`
pau4o Nov 12, 2018
47eb9d7
Add `policy_roles_are()`
pau4o Nov 15, 2018
e2af12c
Add documentation for `policy_roles_are()`
pau4o Nov 15, 2018
538b8f3
Add tests for `policy_roles_are()`
pau4o Nov 15, 2018
74bd9fc
Add `policy_cmd_is()`
pau4o Nov 16, 2018
356903f
Add documentation for `policy_cmd_is()`
pau4o Nov 16, 2018
fdd8bea
Add tests for `policy_cmd_is()`
pau4o Nov 16, 2018
3ad5146
fix: expected output for policy tests
pau4o Nov 16, 2018
3b3f478
Update 9.4 compat.
pau4o Nov 17, 2018
cf0823f
Skip test for policies for versions earlier than 9.5
pau4o Nov 17, 2018
a4dc0e8
Merge pull request #185 from pau4o/master
theory Nov 20, 2018
8592673
Record policy functions in Changes.
theory Nov 20, 2018
c1b1f59
Fix typos in test descriptions
strk Oct 4, 2018
b281cfb
Re-qualify argument type names to be immune of search_path
strk Oct 4, 2018
795e0ad
Add test for testing existance of function taking complex arg in sear…
strk Oct 4, 2018
256f12f
Simpler fix for qualified function args.
theory Nov 20, 2018
9c18298
Add 1.0.0 upgrade script.
theory Nov 20, 2018
2888bb8
Add _funcargs().
theory Nov 20, 2018
80ae103
Get arg checking working on 8.2.
theory Nov 20, 2018
947fa2f
Update patch for 8.1.
theory Nov 20, 2018
4178632
Use name[] until 8.3.
theory Nov 20, 2018
3c98e8d
Merge branch 'strk-search_path_immune_function_args_checking'
theory Nov 20, 2018
453af7d
Add policy test functions to upgrade script.
theory Nov 20, 2018
d111472
First implementation of tests for inheritance.
fluca1978 Oct 1, 2018
6dccf1a
Implementation of the 'is_parent_of' and 'is_child_of' inheritance te…
fluca1978 Oct 1, 2018
d6274e7
Refactoring of '_parent_of' function to accept a inheritance depth.
fluca1978 Oct 1, 2018
f8392d7
Refactoring of the 'is_parent_of()', 'is_child_of()', 'has_inherited_…
fluca1978 Oct 2, 2018
78c6775
Remove format().
fluca1978 Oct 3, 2018
ced4758
Remove format() call.
fluca1978 Oct 10, 2018
fbcd8b3
Fixed several mispelled quote_ident.
fluca1978 Oct 10, 2018
1d13f12
Output file for testing with CI and Travis.
fluca1978 Oct 10, 2018
b25d2bc
Fix inheritance test and expected output.
fluca1978 Oct 10, 2018
4e73201
Remove extra transaction begin in test inheritance.
fluca1978 Oct 10, 2018
2bff2eb
Reformat and move inheritance functions.
theory Nov 20, 2018
9383d6c
Update 9.4 patch for inheritance functions.
theory Nov 20, 2018
7848851
Remove defaults.
theory Nov 20, 2018
ca7b05d
Fully test has_inheritance functions.
theory Nov 20, 2018
defa229
Document casting for has_inherted_tables().
theory Nov 20, 2018
46443d1
Rename is_parent_of to is_ancestor_of.
theory Nov 20, 2018
8f6f8e8
Add is_descendent_of()
theory Nov 20, 2018
4efc1f1
Add isnt_ancestor_of and isnt_descendent_of.
theory Nov 20, 2018
05aa725
Add inheritannce functions to upgrade script.
theory Nov 20, 2018
8522e7a
Record inheritance functions in Changes.
theory Nov 20, 2018
d04f723
Remove ancestor functions on 8.3
theory Nov 20, 2018
2cce233
Add test output for inheritance on 8.1-8.2.
theory Nov 20, 2018
fff1a3e
Merge branch 'inheritance'
theory Nov 20, 2018
73fa3d3
Fix find-and-pastos.
theory Nov 20, 2018
32d3748
Fix handling of sql syntax functions on Postgres 10.
theory Nov 30, 2018
3b7edb8
Allow uninstall of partially installed pgtap
strk Jan 10, 2019
5516f13
Not uninstall change from @strk.
theory Jan 10, 2019
4eec4be
Stamp 1.0.0
decibel Feb 19, 2019
24e2847
Timestamp 1.0.0
decibel Feb 21, 2019
660f372
Increment to v1.0.1.
decibel Feb 21, 2019
0322ca7
Update release.md; add to .gitignore
decibel Feb 21, 2019
d222da4
Fix pgtap_version() in update script for 1.0.0 (#214)
decibel Oct 7, 2019
7e93fa5
Fix tap funky (#215)
decibel Oct 7, 2019
d60b8f5
WIP: Add support for testing upgrade scripts (#128)
decibel Nov 7, 2019
e9449ae
Add test for pg_upgrade (#218)
nasbyj Nov 18, 2019
a170aa4
fix test_user function example (#208)
PeteDevoy Nov 19, 2019
15975a0
Make description optional for col_not_null(schema, table, column) (#221)
nasbyj Nov 19, 2019
341de85
Run tests after pg_upgrade (#222)
nasbyj Nov 22, 2019
1b30e27
Add support for Postgres 12.0 (#223)
nasbyj Nov 23, 2019
1688085
Fix pgtap-core and pgtap-static (#225)
nasbyj Nov 23, 2019
d61983d
Refactor shell scripts (#226)
nasbyj Nov 25, 2019
18081ca
Allow finish() to throw an exception (#227)
nasbyj Nov 25, 2019
b5844d2
Recommend Postgres 9.4 in META.json
nasbyj Nov 25, 2019
a83e2cc
Timestamp v1.1.0
nasbyj Nov 25, 2019
69401b5
Fix docs typo (#231)
jcoleman Jan 8, 2020
e0db8e3
Fix comment typo (#229)
df7cb Jan 8, 2020
0ec9840
Partially bump to 1.2
nasbyj Jan 16, 2020
8c8b426
Add missing update script
nasbyj Jan 16, 2020
cd178fe
Add has_view(:schema, :name) and hasnt_view(:schema, :name) (#230)
Godwottery Jan 17, 2020
d340346
Add item to Changes now since I forgot to credit Godwottery in my merge
nasbyj Jan 17, 2020
a167645
Fix typo
nasbyj Jan 28, 2020
50c2585
Add support for date/time keywords
theory Mar 29, 2020
99fdf94
Remove --load-language
theory May 23, 2020
03636ae
Document need to quote index columns
theory May 23, 2020
007ee2f
Quote current_user as an identifier
theory May 31, 2020
8f8bb50
Fix the `col_not_null()` drop statements
theory Jun 7, 2020
5bfd3c7
add pg13 to ci
wolfgangwalther Oct 25, 2020
608aca0
Remove references to unsupported Postgres versions
theory Oct 24, 2020
642ec69
Use https wherever possible
theory Oct 24, 2020
f9283f7
Update copyright dates
theory Oct 24, 2020
b02e480
Fix pasto (thx @wolfgangwalther)
theory Oct 25, 2020
35e4ecd
Clarify that `pg_prove` needs to be installed
abitrolly Apr 28, 2021
f3fe952
Bring back `checkinstall` phrase
abitrolly Apr 30, 2021
69108cd
Remove leading whitespace
abitrolly Apr 30, 2021
9535cba
Add missing ' to docs for col_default_is() example
decibel May 20, 2021
d3aad95
Remove { DEFAULT | = } and default_expr in uninstall_pgtap.sql
Jan 26, 2021
f24ab4f
Debian deprecates `which`, use `command -v` instead
df7cb Sep 9, 2021
b409303
Document need for -contrib for tests
theory Oct 9, 2021
6d072d9
Fix test failures on Postgres 14
theory Oct 10, 2021
a760d7c
Add isnt_member_of
wolfgangwalther May 29, 2020
3c93cd2
Add docker files for local test environment (#250)
wolfgangwalther Oct 10, 2021
33a2a62
Add pgtag to Dokerfile
theory Oct 10, 2021
57c74f9
Add hasnt_operator, hasnt_leftop, hasnt_rightop (#251)
wolfgangwalther Oct 10, 2021
fc78be3
Skip hasnt_rightop on Postgres 14.
theory Oct 10, 2021
3064044
Follow up to #216 (fixed in 007ee2f). Fixes additional test failures …
mattdeluco Oct 10, 2021
65e4fc9
More credit to @mattdeluco
theory Oct 10, 2021
986e3d4
Improve output of results_eq and results_ne when number of columns or…
wolfgangwalther Oct 10, 2021
07ba0c5
Copyedit Changes
theory Oct 16, 2021
472808e
Disable .psqlrc in parallel_conn.sh
theory Nov 5, 2021
47092f9
Increment copyright date
theory Nov 5, 2021
17e2ea7
Filter ignore tests from serial schedule
theory Nov 5, 2021
5394f34
Note test fixes in changes
theory Nov 5, 2021
4a4815b
Add function type testing
theory Nov 6, 2021
d76abc4
Add comments explaining new util functions
theory Nov 9, 2021
2ccda7f
Replace Travis with GitHub Workflows
theory Nov 13, 2021
c72a59e
Restore upgrade testing in GitHub Actions
theory Nov 27, 2021
6ca7aec
Timestamp v1.2.0
theory Dec 5, 2021
6bae661
Increment to v1.2.1
theory Dec 5, 2021
51c6187
Do not test on tag
theory Jan 17, 2022
364facc
Just use Perl to create uninstall script
theory Apr 17, 2022
335e318
Fix xUnit runner to handle all errors.
theory Apr 17, 2022
d63d6a8
Unindent subtest diag header
theory Apr 17, 2022
8f4a881
Add 2 more col_is_pk() variants without description
theory May 21, 2022
38f2d90
Document handline of temp schemas
theory May 21, 2022
12e0d2f
Fix test failures
theory May 21, 2022
ff4a30b
Thanks @fluca1978!
theory May 21, 2022
e1436a1
Remove redundant DROP FUNCTIONs
robins Jan 21, 2023
c86203e
Note upgrade fix from @robins
theory Jan 21, 2023
56c591f
Use checkout@v3
theory Feb 21, 2023
d0bcb77
Remove SELECT rule from test
theory May 20, 2023
cc0e437
Test Postres 15
theory May 20, 2023
96a7a41
Escape "_" when using LIKE operator
ioguix Jun 8, 2023
6944c1c
Allow short type names for function args.
theory May 14, 2022
1e1d745
Allow short names for most type args
theory May 15, 2022
b12bb44
Tweak installation docs for Docker
theory Aug 13, 2023
45647ce
Tweak installation docs for downloads
theory Aug 13, 2023
46ed5f9
Test on Postgres 16
theory Aug 3, 2023
b9e2da8
Do without server-dev?
theory Aug 14, 2023
4bc2a99
Try using apt.postgresql.org.sh
theory Aug 14, 2023
1d5265a
Test on Postgres 9.1 and 16
theory Aug 14, 2023
acdd768
Increment to and timestamp v1.3.0
theory Aug 14, 2023
b2c9332
Increment to v1.3.1
theory Aug 14, 2023
8a73cbe
Update copyright year
theory Aug 25, 2023
4ec32e7
Improve data type parsing and formatting
theory Sep 18, 2023
67e65ca
Replace _quote_ident_like() with _typename()
theory Sep 23, 2023
d663c04
Fix patch offesets
theory Sep 23, 2023
b000b4b
Add the `has_pk(:schema, :table)` variant
theory Sep 23, 2023
e94465b
Revamp results target
theory Sep 24, 2023
bcecdab
Timestamp v1.3.1
theory Sep 24, 2023
e14d800
Increment to v1.3.2
theory Sep 24, 2023
6fdae2b
Fix latest-changes.md make target
theory Sep 24, 2023
83b4585
Rename master branch to main
theory Sep 24, 2023
c47f862
Update pgtap.mmd: minor corrections
cstork Oct 2, 2023
1ace153
Replace C parse_type() function with PL/pgSQL
theory Feb 3, 2024
2bfb010
Test and document proc with function assertions
theory Feb 4, 2024
0f62166
Timestamp v1.3.2
theory Feb 4, 2024
f65094c
Increment to v1.3.3
theory Feb 4, 2024
7462b56
Run qualified typmodin function in format_type_string()
ewie Feb 10, 2024
02bc769
Note `col_type_is`/`format_type_string` fix in Changes
theory Feb 17, 2024
f5d166b
Fix a couple of links in the documentation
theory Feb 26, 2024
b0184e4
Use `to_regtypemod` on Postgres 17
theory Apr 1, 2024
b941782
Timestamp v1.3.3
theory Apr 8, 2024
1315a10
[docs] PG compatible logical replication architecture (#23220)
siddharth2411 Jul 17, 2024
88e92a0
[#23216] yugabyted: Adding a new field ObjectName to model SqlObjectM…
nchandrappa Jul 16, 2024
7786cf7
[PLAT-12072][Platform] Implement Task Details Drawer
haikarthikssk Jul 17, 2024
95fb188
[PLAT-14225] Implement v2 Group Mapping APIs
asharma-yb Jul 1, 2024
8e33f45
[PLAT-12085]: Modify the confirm modal box depending on the type of e…
rajmaddy89 Jul 15, 2024
87fe4b8
[doc][yba] add OIDC URI example (#23222)
ddhodge Jul 17, 2024
c212f4b
[docs] Logical replication explore docs sections (#23231)
siddharth2411 Jul 17, 2024
0619b50
CDC Docs changes (#23234)
ymahajan Jul 17, 2024
4823cd4
[doc][yba] Encryption in transit update (#23027)
ddhodge Jul 18, 2024
c5dd61b
[PLAT-14344] Support Premium SSD V2 disks in azure YBA managed provider
rajmaddy89 Jul 12, 2024
4ca56cf
[PLAT-6774] Enable changing RF for existing universe
yorq Jul 16, 2024
4af129f
[PLAT-14685] - improvement : Disable Gflags change if gflags belongs …
Lingeshwar Jul 18, 2024
a64fbfc
[#23120] YSQL: Do not wait for a safe snapshot in serializable read o…
pao214 Jul 17, 2024
9f82c01
[#23188] DocDB: Persist new colocated_id mapping discovered as part o…
lingamsandeep Jul 18, 2024
1522522
Update third-party dependencies to remove CentOS 7
mbautin Jul 18, 2024
cd7410c
2.18.1.1 release notes (#23241)
ddhodge Jul 18, 2024
550458d
[#23047] docdb: Fix cotable ids in flushed frontier at restore
Huqicheng Jul 16, 2024
225ddfe
[PLAT-14700] Make node-agent error message on installation to be more…
nkhogen Jul 17, 2024
9c9a059
[PLAT-14563] Fixing disk mounting logic to use mount points defined i…
amannijhawan Jul 19, 2024
84eefbd
[DOC-368] Azure workload identity docs changes (#22881)
aishwarya24 Jul 19, 2024
781af0d
[#23183] xCluster: Move Setup, Bootstrap, Alter and Delete Target Rep…
hari90 Jul 18, 2024
1d646b1
[docs] Add ysql_output_buffer_size to yb-tserver config reference. (#…
pao214 Jul 19, 2024
2d95dd2
Fix the issue yaml parsing
Vars-07 Jul 19, 2024
dd9e85b
[PLAT-14534]Add regex match for GCP Instance template
asharma-yb Jul 12, 2024
d3bba18
update diagram (#23245)
ddhodge Jul 19, 2024
78b317c
[/PLAT-14708] Fix JSON field name in TaskInfo query
nkhogen Jul 19, 2024
ac9164b
[#23173] DocDB: Allow large bytes to be passed to RateLimiter
hari90 Jul 19, 2024
5a76f6a
[#23179] CDCSDK: Support data types with dynamically alloted oids in CDC
Sumukh-Phalgaonkar Jul 19, 2024
e8e3901
Add 'src/postgres/third-party-extensions/pgtap/' from commit 'b941782…
Jul 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[yugabyte#23188] DocDB: Persist new colocated_id mapping discovered a…
…s part of processing CHANGE_METADATA_OP in xCluster ClusterConfig.

Summary:
Problem:

When a new table is added to a colocated database, the table needs to be created on both xCluster source and target with the same colocation_id.
As part of processing the ChangeMetadataOp for the AddTable operation received from the source, the target creates a mapping of source->target schema versions of the newly created table. However, this is not getting persisted in ClusterConfig if the source/target schema versions are default values. As a result while replication may work immediately after setup, upon a restart of the T-server, the mapping of source-target schema versions may be lost and replication may stall until another schema change happens on the source.

Fix:
Fix is to detect the non-existent colocation_id correctly and persisting the ClusterConfig.

Test Plan:
ybt xcluster_ysql_colocated-test XClusterYsqlColocatedTest.DatabaseReplication

The test was failing without the fix and is passing with the fix.

Reviewers: hsunder, xCluster

Reviewed By: hsunder

Subscribers: ybase

Differential Revision: https://phorge.dev.yugabyte.com/D36552
  • Loading branch information
lingamsandeep committed Jul 18, 2024
commit 9f82c017b59faa674364494e8630189567e1df52
44 changes: 38 additions & 6 deletions src/yb/integration-tests/xcluster/xcluster_ysql_colocated-test.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) YugabyteDB, Inc.
// Copyright (c) YugaByte, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
@@ -23,6 +23,7 @@
#include "yb/master/master_ddl.proxy.h"
#include "yb/master/master_replication.proxy.h"
#include "yb/master/mini_master.h"
#include "yb/tserver/mini_tablet_server.h"
#include "yb/util/backoff_waiter.h"

DECLARE_bool(xcluster_wait_on_ddl_alter);
@@ -118,6 +119,7 @@ class XClusterYsqlColocatedTest : public XClusterYsqlTestBase {
auto& tables = onlyColocated ? colocated_consumer_tables : consumer_tables_;
for (const auto& consumer_table : tables) {
LOG(INFO) << "Checking records for table " << consumer_table->name().ToString();
RETURN_NOT_OK(WaitForRowCount(consumer_table->name(), num_results, &consumer_cluster_));
RETURN_NOT_OK(ValidateRows(consumer_table->name(), num_results, &consumer_cluster_));
}
return true;
@@ -196,28 +198,58 @@ class XClusterYsqlColocatedTest : public XClusterYsqlTestBase {
[&]() -> Result<bool> {
LOG(INFO) << "Checking records for table "
<< new_colocated_consumer_table->name().ToString();
RETURN_NOT_OK(
ValidateRows(new_colocated_consumer_table->name(), kRecordBatch, &consumer_cluster_));
RETURN_NOT_OK(WaitForRowCount(
new_colocated_consumer_table->name(), kRecordBatch, &consumer_cluster_));
RETURN_NOT_OK(ValidateRows(
new_colocated_consumer_table->name(), kRecordBatch, &consumer_cluster_));
return true;
},
MonoDelta::FromSeconds(20 * kTimeMultiplier),
"IsDataReplicatedCorrectly new colocated table"));

// 6. Drop the new table and ensure that data is getting replicated correctly for
// 6. Shutdown the colocated tablet leader and verify that replication is still happening.
{
auto tablet_ids = ListTabletIdsForTable(consumer_cluster(), colocated_parent_table_id);
auto old_ts = FindTabletLeader(consumer_cluster(), *tablet_ids.begin());
old_ts->Shutdown();
const auto deadline = CoarseMonoClock::Now() + 10s * kTimeMultiplier;
RETURN_NOT_OK(WaitUntilTabletHasLeader(consumer_cluster(), *tablet_ids.begin(), deadline));
RETURN_NOT_OK(old_ts->RestartStoppedServer());
RETURN_NOT_OK(old_ts->WaitStarted());

RETURN_NOT_OK(InsertRowsInProducer(
kRecordBatch, 2 * kRecordBatch, new_colocated_producer_table,
use_transaction));

RETURN_NOT_OK(WaitFor(
[&]() -> Result<bool> {
LOG(INFO) << "Checking records for table "
<< new_colocated_consumer_table->name().ToString();
RETURN_NOT_OK(WaitForRowCount(
new_colocated_consumer_table->name(), 2 * kRecordBatch, &consumer_cluster_));
RETURN_NOT_OK(ValidateRows(
new_colocated_consumer_table->name(), 2 * kRecordBatch, &consumer_cluster_));
return true;
},
MonoDelta::FromSeconds(20 * kTimeMultiplier),
"IsDataReplicatedCorrectly new colocated table"));
}

// 7. Drop the new table and ensure that data is getting replicated correctly for
// the other tables
RETURN_NOT_OK(
DropYsqlTable(&producer_cluster_, namespace_name, "", Format("test_table_$0", idx)));
LOG(INFO) << Format("Dropped test_table_$0 on Producer side", idx);

// 7. Add additional data to the original tables.
// 8. Add additional data to the original tables.
for (const auto& producer_table : producer_tables_) {
LOG(INFO) << "Writing records for table " << producer_table->name().ToString();
RETURN_NOT_OK(
InsertRowsInProducer(count, count + kRecordBatch, producer_table, use_transaction));
}
count += kRecordBatch;

// 8. Verify all tables are properly replicated.
// 9. Verify all tables are properly replicated.
RETURN_NOT_OK(WaitFor(
[&]() -> Result<bool> { return data_replicated_correctly(count, false); },
MonoDelta::FromSeconds(20 * kTimeMultiplier),
10 changes: 8 additions & 2 deletions src/yb/master/xrepl_catalog_manager.cc
Original file line number Diff line number Diff line change
@@ -5670,16 +5670,22 @@ Status CatalogManager::UpdateConsumerOnProducerMetadata(
schema_cached->Clear();

cdc::SchemaVersionsPB* schema_versions_pb = nullptr;
bool schema_versions_updated = false;

// TODO (#16557): Support remove_table_id() for colocated tables / tablegroups.
if (IsColocationParentTableId(consumer_table_id) && req->colocation_id() != kColocationIdNotSet) {
auto map = stream_entry->mutable_colocated_schema_versions();
schema_versions_pb = &((*map)[req->colocation_id()]);
schema_versions_pb = FindOrNull(*map, req->colocation_id());
if (nullptr == schema_versions_pb) {
// If the colocation_id itself does not exist, it needs to be recorded in clusterconfig.
// This is to handle the case where source-target schema version mapping is 0:0.
schema_versions_updated = true;
schema_versions_pb = &((*map)[req->colocation_id()]);
}
} else {
schema_versions_pb = stream_entry->mutable_schema_versions();
}

bool schema_versions_updated = false;
SchemaVersion current_producer_schema_version =
schema_versions_pb->current_producer_schema_version();
SchemaVersion current_consumer_schema_version =