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
DBZ-5423 Add test case to support table rename for SQLServer #3738
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ani-sha, I wonder since we are wanting to verify all aspects around a rename, could you adjust the test case to also check the contents of the schema history topic as well?
d63628c
to
d8d1f3c
Compare
Hi @ani-sha I left a comment on the Jira issue. I've added a small change to your test case to account for what I described in the Jira to highlight that the behavior isn't exactly as straightforward as it appears to be described in the issue. You'll notice that adding the restart & verifying that the table name doesn't change in the later events fails the topic-name assumption. |
@Naros Yes I went through the comments. But what should actually be the behavior in such a case? |
Hi @ani-sha so I think the actual behavior should mimic what we see for other connectors, once the table is renamed, the old table name is effectively non-existent and we should always emit changes based on that new name. I believe what we need to understand is:
Perhaps there is something cached somewhere in the scope of (1) that gets lost when the connector is restarted in (2). In either case, could you explain why the connector works the way it does first, and then we discuss what and how should the code be changed. |
Thanks for the input @Naros. I am looking into this. |
So @ani-sha SQL Server relies on a What we need to do is to determine the right moment when the source table changes and call |
So we don't specifically mention anything about First, we have a table called Second, we again have this table called What I am not yet sure of (but I'm very skeptical its possible) is to connect the dots with whatever the object metadata is in the database. For example, if the database object has an id that remains the same after the rename, we could use this to detect the rename by querying the database information schema on each iteration. This does mean that the emission of events may not align precisely to when the rename occurred, but given the first scenario we already have this problem as-is. The alternative is quite simply outline that But what is clear, regardless, is that the behavior of the connector to continue to emit changes under the old table name is not intended and is in fact what I would consider a bug, but one that we need to find an elegant way to fix. |
I can confirm that
|
9148d1c
to
6160a16
Compare
82ed876
to
a218c81
Compare
a218c81
to
91b4d88
Compare
91b4d88
to
97bfada
Compare
https://issues.redhat.com/browse/DBZ-5423