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

[doc][2024.2.2] Bidirectional xCluster adding indexes #25744

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,27 @@ However, to add a new index to a table that already has data, the following addi
Replication altered successfully
```

#### Adding indexes in bidirectional replication
#### Adding YCQL indexes in bidirectional replication

Stop all write traffic when adding a new index to a table that is bidirectionally replicated.
Stop all write traffic when adding a new index to a YCQL table that is bidirectionally replicated.

Follow the same steps as described in [Adding indexes in unidirectional replication](#adding-indexes-in-unidirectional-replication), followed by bootstrapping the index on the target universe and adding it to the source universe (steps 4 and 8 in the opposite direction).

#### Adding YSQL indexes in bidirectional replication

{{< note title="Note" >}}
For versions lower than v2024.2.2.0 follow the same steps as described in [Adding YCQL indexes in bidirectional replication](#adding-ycql-indexes-in-bidirectional-replication).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For versions lower than v2024.2.2.0 follow the same steps as described in [Adding YCQL indexes in bidirectional replication](#adding-ycql-indexes-in-bidirectional-replication).
For v2024.2.1 and earlier, follow the same steps as described in [Adding YCQL indexes in bidirectional replication](#adding-ycql-indexes-in-bidirectional-replication).

{{< /note >}}

New YSQL indexes are automatically added to xCluster replication if the YSQL table being indexed is bidirectionally replicated.
Adding new indexes is supported even if the table being indexed contains data and is actively receiving writes on both the universes.

Create the [index](../../../../api/ysql/the-sql-language/statements/ddl_create_index/) on both the universes **simultaneously**. xCluster will internally detect and add the new indexes to replication in both directions, and ensure all the data is backfilled.

{{< note title="Note" >}}
If the create index DDL statement is only issued on one universe, it will timeout and fail.
{{< /note >}}

### Removing objects

Objects (tables, indexes, partitions) need to be removed from replication before they can be dropped as follows:
Expand Down