mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
With parallel replication we have had a couple of bugs where DDL's
(like DROP TABLE) has been scheduled before conflicting DDL's (like INSERT) are commited. What makes these bugs hard to detect is that in most cases any wrong schduling are caught by MDL locks. It's only when there are timing issues that the bugs (usually deadlocks) are noticed. This patch adds a DBUG_ASSERT() that detects, in parallel replication, if a DDL is scheduled before any depending DML'S are commited. It does this be checking if there are any conflicting replication locks when the DDL is about to wait for getting it's MDL lock. I also did some minor code cleanups in sql_base.cc to make this code similar to other related code.
This commit is contained in:
@ -3778,7 +3778,7 @@ private:
|
||||
|
||||
/* Protect against add/delete of temporary tables in parallel replication */
|
||||
void rgi_lock_temporary_tables();
|
||||
void rgi_unlock_temporary_tables();
|
||||
void rgi_unlock_temporary_tables(bool clear);
|
||||
bool rgi_have_temporary_tables();
|
||||
public:
|
||||
/*
|
||||
@ -3802,15 +3802,15 @@ public:
|
||||
if (rgi_slave)
|
||||
rgi_lock_temporary_tables();
|
||||
}
|
||||
inline void unlock_temporary_tables()
|
||||
inline void unlock_temporary_tables(bool clear)
|
||||
{
|
||||
if (rgi_slave)
|
||||
rgi_unlock_temporary_tables();
|
||||
rgi_unlock_temporary_tables(clear);
|
||||
}
|
||||
inline bool have_temporary_tables()
|
||||
{
|
||||
return (temporary_tables ||
|
||||
(rgi_slave && rgi_have_temporary_tables()));
|
||||
(rgi_slave && unlikely(rgi_have_temporary_tables())));
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user