-
Notifications
You must be signed in to change notification settings - Fork 411
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
ddl: Fix adding vector index on empty table may blocked forever #9470
ddl: Fix adding vector index on empty table may blocked forever #9470
Conversation
@@ -243,7 +243,6 @@ void InterpreterSelectQuery::getAndLockStorageWithSchemaVersion(const String & d | |||
|| (managed_storage->engineType() != ::TiDB::StorageEngine::DT | |||
&& managed_storage->engineType() != ::TiDB::StorageEngine::TMT)) | |||
{ | |||
LOG_DEBUG(log, "{}.{} is not ManageableStorage", database_name, table_name); |
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.
Running queries on the system table will trigger this logging, which is verbose but not provide any information. Remove it.
Why not just insert a row even when store is not init? |
Not sure whether this idea is ok, we may also regard progress=1 and missing table in tiflash_indexes as index build is finished, because progress=1 already means TiFlash is aware of this table, and then no entry in tiflash_indexes means exactly this case? |
@breezewish No, we can not tell the difference between these two cases
|
@Lloyd-Pottiger tiflash/dbms/src/Storages/System/StorageSystemDTLocalIndexes.cpp Lines 91 to 98 in 1a781c7
|
The index info can get from table info, and the rows indexed is 0. |
2337578
to
2b98e1f
Compare
b60ba2a
to
62b868d
Compare
6f3a586
to
aa597a9
Compare
aa597a9
to
56546e4
Compare
/retest |
56546e4
to
679765d
Compare
@Lloyd-Pottiger @JinheLin PTAL |
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
Need to update description. |
Updated |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JinheLin, Lloyd-Pottiger The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
What problem does this PR solve?
Issue Number: ref #9032
Problem Summary:
When creating vector index on empty table, the DDL may be blocked forever.
This is because when an empty table is synced to TiFlash, the
StorageDeltaMerge
is created without initializing theDeltaMergeStore
instance. This is to avoid generating too many fragmented, small files that exhaust the filesystem inode.However, if the
DeltaMergeStore
instance is not created, thensystem.dt_local_index
will not get the local index stats. Which make tidb consider the vector index is still under building and the ddl does not end.tiflash/dbms/src/Storages/System/StorageSystemDTLocalIndexes.cpp
Lines 88 to 94 in 1a781c7
What is changed and how it works?
StorageDeltaMerge
is created butDeltaMergeStore
is not inited, then generate the local index info by the TiDB::TableInfoSmall refactor:
Check List
Tests
Side effects
Documentation
Release note