-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Bug-fix] Ignore modified table log when table has been dropped #5688
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
Conversation
|
can we just simply skip replayUpdateReplica if table has been dropped. because someone may drop db, so we still need to lock catalog? |
|
If this problem occurs, there is something wrong with the metadata access mechanism itself. |
Indeed, if we have to add db locks for this situation, basically table locks are of little significance. |
caiconghui
left a comment
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.
LGTM
morningman
left a comment
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.
LGTM
Although the table lock can control the simultaneous modification of the table by different threads. But it cannot control the drop operation of the table by other threads. For example, when drop table and table update occur at the same time. 1. get table object by thread 1 2. drop table by thread 2 with table lock 3. update table object by thread 1 The above process is possible. At this time, step 3 actually operates a table that no longer exists, which will eventually cause the wrong metadata to be recorded. Fixed apache#5687
morningman
left a comment
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.
LGTM
…he#5688) [Merge from github][doris-1077][827f5c0] Although the table lock can control the simultaneous modification of the table by different threads. But it cannot control the drop operation of the table by other threads. For example, when drop table and table update occur at the same time. 1. get table object by thread 1 2. drop table by thread 2 with table lock 3. update table object by thread 1 The above process is possible. At this time, step 3 actually operates a table that no longer exists, which will eventually cause the wrong metadata to be recorded. Fixed apache#5687 Change-Id: If0bc36efacc0188eb68d42f609b0eb80f24ea38e
Although the table lock can control the simultaneous modification of the table by different threads.
But it cannot control the drop operation of the table by other threads.
For example, when drop table and table update occur at the same time.
The above process is possible.
At this time, step 3 actually operates a table that no longer exists, which will eventually cause NullPointerException.
In fact, the modified table log after the drop table can be ignored. The reason is that it is meaningless to modify information on a table that no longer exists.
Fixed #5687
Types of changes
What types of changes does your code introduce to Doris?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.