MDEV-29252: Avoid masking specific IO thread errors with generic relay log write failure#4676
MDEV-29252: Avoid masking specific IO thread errors with generic relay log write failure#4676abhishek593 wants to merge 1 commit intoMariaDB:10.11from
Conversation
e8caf98 to
e9290ad
Compare
gkodinov
left a comment
There was a problem hiding this comment.
Please squash all of your commits into a single one.
Please also target 10.11: this is a bug fix and it needs to be in all affected versions.
There was a problem hiding this comment.
I'd suggest not to send anything here and fix queue_event to send it in all cases.
Note that this also requires checking all the error paths in queue_event() and making sure no tricks are played to work around the below check.
There was a problem hiding this comment.
I have updated the implementation. I found only 1 instance where we could return without going through err: label in queue_event(), which is queue_old_event(). There, previously, it just sent error 1, instead of standard error codes, and in handle_slave_io(), it printed errors for ER_SLAVE_RELAY_LOG_WRITE_FAILURE.
Now, I change this return error 1 in queue_old_event() directly to ER_SLAVE_RELAY_LOG_WRITE_FAILURE, which goes through the err: label in queue_event(), and all error reporting happens there.
| @@ -6752,7 +6919,7 @@ static int queue_event(Master_info* mi, const uchar *buf, ulong event_len) | |||
| handle_slave_io() prints it on return. | |||
| */ | |||
| if (unlikely(error) && error != ER_SLAVE_RELAY_LOG_WRITE_FAILURE) | |||
| mi->report(ERROR_LEVEL, error, NULL, ER_DEFAULT(error), | |||
| mi->report(ERROR_LEVEL, error, NULL, ER_THD(mi->io_thd, error), | |||
There was a problem hiding this comment.
Any specific reason to do this? How is it connected to the problem?
There was a problem hiding this comment.
I did this because previously, when ER_SLAVE_RELAY_LOG_WRITE_FAILURE was handled in handle_slave_io(), it used ER_THD, so to keep the same behaviour. With this change, all errors use ER_THD.
There was a problem hiding this comment.
OK. I hope there's always a THD when you are here. Let's have the final reviewer check on that.
d7112bd to
01fa5f7
Compare
…y log write failure
01fa5f7 to
39fc9f4
Compare
gkodinov
left a comment
There was a problem hiding this comment.
LGTM. Please stand by for the final review.
This PR ensures that the slave IO thread reports specific error codes instead of masking them with the generic ER_SLAVE_RELAY_LOG_WRITE_FAILURE.
Changes: