-
Frazer Clement authored
Automated binlog purge caused a MySQLD crash. This was because purging a Binlog file has an associated DELETE from the ndb_binlog_index file to remove entries for epochs stored in the Binlog Index file. This DELETE is executed using the current 'THD' structure in the purge code context. However, the purge code can be called as a discrete command, in which case the THD is quite usable, or just after writing an event to the Binlog, which can be embedded in the depths of processing some other statement. In this case, the THD generally is not in a state to be used to start a fresh DELETE command. To get around this problem, the PURGE DELETE code is changed to create and use a fresh THD object. This THD object is initialised to the best of the Ndb handler's ability. Some extra steps are taken to make sure it does not itself generate Binlog etc. A new testcase is added to the ndb_binlog suite to test this purge-as-part-of-writing-an-event case. The testcase uses a new error insertion (DBUG_EXECUTE_IF) added to Server code. This code has been pushed to 5.6 and trunk, so is only an MCP patch up to the 5.6 release.
Frazer Clement authoredAutomated binlog purge caused a MySQLD crash. This was because purging a Binlog file has an associated DELETE from the ndb_binlog_index file to remove entries for epochs stored in the Binlog Index file. This DELETE is executed using the current 'THD' structure in the purge code context. However, the purge code can be called as a discrete command, in which case the THD is quite usable, or just after writing an event to the Binlog, which can be embedded in the depths of processing some other statement. In this case, the THD generally is not in a state to be used to start a fresh DELETE command. To get around this problem, the PURGE DELETE code is changed to create and use a fresh THD object. This THD object is initialised to the best of the Ndb handler's ability. Some extra steps are taken to make sure it does not itself generate Binlog etc. A new testcase is added to the ndb_binlog suite to test this purge-as-part-of-writing-an-event case. The testcase uses a new error insertion (DBUG_EXECUTE_IF) added to Server code. This code has been pushed to 5.6 and trunk, so is only an MCP patch up to the 5.6 release.
Loading