Skip to content

Commit 3f843c9

Browse files
arnabray21dahlerlend
authored andcommitted
Bug#31341888 RECURRING TEMPORARY ERRORS STALL NDB METADATA SYNC
Post push fix: Temporary errors are bumped up to permanent ones only when ndb_metadata_sync is enabled. Recurring temporary errors are expected in the general use case for auto sync especially when the restore takes longer to complete. Objects being synchronized are more likely to be prematurely blacklisted in such scenarios. Change-Id: I6f8f4fb40f1059ebb936da0ee0ba16093cef6125
1 parent 598d1c8 commit 3f843c9

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

storage/ndb/plugin/ndb_metadata_sync.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,25 @@ unsigned int Ndb_metadata_sync::get_blacklist_count() {
486486
return m_blacklist.size();
487487
}
488488

489+
extern bool opt_ndb_metadata_sync;
490+
489491
bool Ndb_metadata_sync::retry_limit_exceeded(const std::string &schema_name,
490492
const std::string &name,
491493
object_detected_type type) {
494+
if (!opt_ndb_metadata_sync) {
495+
/*
496+
The ndb_metadata_sync variable hasn't been set. This is then the default
497+
automatic sync mechanism where it's better to retry indefinitely under the
498+
assumption that the temporary error will have disappeared by the time the
499+
next discovery + sync attempt occurs.
500+
*/
501+
return false;
502+
}
503+
/*
504+
The ndb_metadata_sync variable has been set. Check if the retry limit (10)
505+
has been hit in which case the object is added to the blacklist by the
506+
caller.
507+
*/
492508
std::lock_guard<std::mutex> guard(m_retry_objects_mutex);
493509
for (Detected_object &object : m_retry_objects) {
494510
if (object.m_type == type && object.m_schema_name == schema_name &&

storage/ndb/plugin/ndb_metadata_sync.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ class Ndb_metadata_sync {
336336

337337
/*
338338
@brief Checks if the number of times the synchronization of an object has
339-
been retried has exceeded the retry limit
339+
been retried has exceeded the retry limit. This is applicable only
340+
when ndb_metadata_sync is used
340341
341342
@param schema_name Name of the schema
342343
@param name Name of the object

0 commit comments

Comments
 (0)