Skip to content

Commit

Permalink
ddl: Do not succee the last_gc_safepoint when physically dropping tab…
Browse files Browse the repository at this point in the history
…le is skipped (#8910)

close #8911
  • Loading branch information
JaySon-Huang authored Apr 8, 2024
1 parent fe14588 commit 35e0a1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dbms/src/TiDB/Schema/SchemaSyncService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,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 @@ -343,7 +344,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 @@ -397,7 +398,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

0 comments on commit 35e0a1e

Please sign in to comment.