Skip to content

feat(diff): add support for altered change stream states with recreating table#78

Merged
daichirata merged 1 commit intodaichirata:masterfrom
sters:master
Dec 10, 2025
Merged

feat(diff): add support for altered change stream states with recreating table#78
daichirata merged 1 commit intodaichirata:masterfrom
sters:master

Conversation

@sters
Copy link
Copy Markdown
Contributor

@sters sters commented Dec 3, 2025

If there is a recreating table diff which used on ChangeStream, the ChangeStream also recreated in the diff. But it makes a downtime on the ChangeStream.

As an alternative, I would suggest applying ALTER CHANGE STREAM twice.

  []string{
-       "ALTER CHANGE STREAM CS1 SET FOR T2",
+       "DROP CHANGE STREAM CS1",
        "DROP TABLE T1",
        "CREATE TABLE T1 (\n  id INT64,\n  name STRING(100) NOT NULL\n) PRIM"...,
        strings.Join({
-               "ALTER CHANGE STREAM CS1 SET",
+               "CREATE CHANGE STREAM CS1",
                " FOR T1, T2",
        }, ""),
  }

@sters
Copy link
Copy Markdown
Contributor Author

sters commented Dec 4, 2025

@daichirata Please review this PR if you have time. 🙏

@daichirata daichirata merged commit 68edea3 into daichirata:master Dec 10, 2025
6 checks passed
@daichirata
Copy link
Copy Markdown
Owner

Thanks for the fix! I've merged it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants