yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.86k stars 1.05k forks source link

[xCluster][DDL Replication] Table state is stuck at preparing state on target #23610

Open agsh-yb opened 2 weeks ago

agsh-yb commented 2 weeks ago

Jira Link: DB-12523

Description

Version: 2.23.1.0-b55

After performing several operations, I attempted to set up replication and create a table at the source. However, the process is taking significantly longer than expected(Stuck) to fetch the table at the target. The UI indicates that the table is in the “preparing” state.

Steps performed:

yugabyte=# \c db8
You are now connected to database "db8" as user "yugabyte".
db8=# create table t (id int);
CREATE TABLE
db8=# select * from yb_xcluster_ddl_replication.ddl_queue;
    start_time    | query_id  |                                                                               
        yb_data                                                                                        
------------------+-----------+-------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
 1724440824452743 | 696290502 | {"user": "yugabyte", "query": "create table t (id int);", "schema": "public", 
"version": 1, "command_tag": "CREATE TABLE", "new_rel_map": [{"rel_name": "t", "relfile_oid": 16402}]}
(1 row)
361043889-fef4872f-161a-4a54-aa76-36cf2c5d180b

Additional Information:

Support bundles for both the source and target have been created and attached to the corresponding Jira ticket for further investigation.

Screenshot 2024-08-24 at 1 00 44 AM

cc: @Arjun-yb

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

agsh-yb commented 2 weeks ago

If I tries to create table in another database which is already under replication with in replication group it's restricting to do so with error

db5=# create table ts(id int);
ERROR:  Error parsing ddl_queue_primary_key_start_time: