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) (#8913)

close #8911
  • Loading branch information
ti-chi-bot authored Apr 9, 2024
1 parent 9f01a89 commit dde6a2a
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 @@ -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

0 comments on commit dde6a2a

Please sign in to comment.