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

ddl: Do not succee the last_gc_safepoint when physically dropping table is skipped (#8910) #8913

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dbms/src/TiDB/Schema/SchemaSyncService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ bool SchemaSyncService::gcImpl(Timestamp gc_safepoint, KeyspaceID keyspace_id, b
storage->getTombstone(),
gc_safepoint,
canonical_name);
succeeded = false; // dropping this table is skipped, do not succee the `last_gc_safepoint`
continue;
}
else
Expand Down Expand Up @@ -346,7 +347,7 @@ bool SchemaSyncService::gcImpl(Timestamp gc_safepoint, KeyspaceID keyspace_id, b
}
catch (DB::Exception & e)
{
succeeded = false;
succeeded = false; // dropping this table is skipped, do not succee the `last_gc_safepoint`
String err_msg;
// Maybe a read lock of a table is held for a long time, just ignore it this round.
if (e.code() == ErrorCodes::DEADLOCK_AVOIDED)
Expand Down Expand Up @@ -400,7 +401,7 @@ bool SchemaSyncService::gcImpl(Timestamp gc_safepoint, KeyspaceID keyspace_id, b
}
catch (DB::Exception & e)
{
succeeded = false;
succeeded = false; // dropping this database is skipped, do not succee the `last_gc_safepoint`
String err_msg;
if (e.code() == ErrorCodes::DEADLOCK_AVOIDED)
err_msg = "locking attempt has timed out!"; // ignore verbose stack for this error
Expand Down