Skip creating and renaming the temp inner table of non-append Refreshable MV DDLs in Replicated DBs#84858
Conversation
|
Workflow [PR], commit [8f331e0] Summary: ❌
|
f3e5221 to
72251cc
Compare
72251cc to
6cbf8c9
Compare
|
In the new push, I added |
antaljanosbenjamin
left a comment
There was a problem hiding this comment.
Sorry for the late review.
| if (coordination_znode.last_success_table_uuid == create_uuid) | ||
| return false; | ||
|
|
||
| LOG_TEST(log, "ddl_log_ctime {}, stats.mtime {}", ddl_log_ctime, stats.mtime); | ||
| return ddl_log_ctime < stats.mtime; |
There was a problem hiding this comment.
Let's make sure I understood these conditions correctly.
I think the first one means we should always create the table that is the current table, because that is necessary.
The second one is more cryptic IMO. Skip creating table if the DDL log was created before the last update of the coordination info? I guess this means there will be some new tables.
There was a problem hiding this comment.
I added comments in the code file and updated the PR description. Please let me know if it needs to be clarified further.
tests/integration/test_refreshable_mv_skip_old_temp_table_ddls/test.py
Outdated
Show resolved
Hide resolved
tests/integration/test_refreshable_mv_skip_old_temp_table_ddls/test.py
Outdated
Show resolved
Hide resolved
tests/integration/test_refreshable_mv_skip_old_temp_table_ddls/test.py
Outdated
Show resolved
Hide resolved
6cbf8c9 to
5390ad9
Compare
…tables_ddls_of_refreshable_materialized_views. If enabled, when processing DDLs in DatabaseReplicatedDDLWorker, it skips creating and exchanging DDLs of the temporary tables of refreshable materialized views if possible.
5390ad9 to
59eb898
Compare
| return false; | ||
|
|
||
| LOG_TEST(log, "ddl_log_ctime {}, stats.mtime {}", ddl_log_ctime, stats.mtime); | ||
| // It is possible the the temporary table is created and replciated before the the coordiation info is updated. |
There was a problem hiding this comment.
But this can be fixed in another PR, you don't have to run a whole CI again.
| // It is possible the the temporary table is created and replciated before the the coordiation info is updated. | |
| // It is possible the the temporary table is created and replciated before the coordiation info is updated. |
a5f26fd
|
@tuanpach new test is flaky. Should we revert? |
Let me check it first. |
|
In the test, the DB is recovered, so no DDLs to skip. I will update the test to make it stable. |
…
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Skip creating and renaming the old temp table of non-append RMV DDLs in Replicated DBs.
Refreshing in non-append Refreshable Materialized Views:
Queries created in steps 1, 3, and 4 are replicated through the DDL logs.
If a replica is woken up after a long sleep, there are lots of creating, renaming and dropping DDLs generated by the RMVs.
To speed up the DDL processing, these old create DDLs are skipped.
Once the creating DDL is skipped, there is no table to rename in the renaming DDL, so the renaming DDL is skipped if the table name does not exist.
For the dropping DDLs, as the query contains
IF EXISTS, we don't need to skip.Enable this logic with DB replicated setting
allow_skipping_old_temporary_tables_ddls_of_refreshable_materialized_views.Documentation entry for user-facing changes