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

let operator fix publications without tables #2722

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

FxKu
Copy link
Member

@FxKu FxKu commented Aug 9, 2024

We had the situation that a publication, slot and stream CRD were there but no publication tables. Not sure, how we ended up there. Maybe the stream operator created it after our operator did not block the slot and crd creation even when the table did not exist yet.

No publication tables leads to the following error in the operator:

could not sync publications in database "my_db": could not get current publications: error when processing row: sql: Scan error on column index 1, name "string_agg": converting NULL to string is unsupported

To support NULL values one can use go.sql's NullString implementation to catch this. But what to do next then? Set publications[pubName] = nil? This would make a later comparison between desired and current tables impossible.

Instead, this PR suggest to return an empty string. On sync the diff should be noticed and the operator would alter the publication and set a new table list.

@FxKu FxKu added the bugfix label Aug 9, 2024
@FxKu FxKu added this to the 1.13.0 milestone Aug 9, 2024
@FxKu
Copy link
Member Author

FxKu commented Aug 9, 2024

👍

1 similar comment
@sdudoladov
Copy link
Member

👍

@FxKu FxKu merged commit d5a88f5 into master Aug 9, 2024
12 checks passed
@FxKu FxKu deleted the publication-without-tables branch August 9, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants