Re: [Maria-developers] 12d5c4f2813: Fixed problems with S3 after "DROP TABLE FORCE" changes

Hi, Monty! On Oct 16, Michael Widenius wrote:
please put the MDEV on the first line of the commit comment
What do you mean, a slave is delayed?
why binlog_commit is even called here?
you created a generally looking function with a rather special behavior. Please rename it to make sure it's not a general purpose helper. For example, call it binlog_current_query_unfiltered() or force_binlog_current_query(). And the function comment should say Force-binlog current query as a statement ignoring the binlog filter setting
why did you move it up?
abort label doesn't look at `res` it returns `retval`. So I don't think you need `retval= thd->is_error()` at all, and instead you need if (res < 0) retval= thd->binlog_current_query();
why did you move this up?
As far as I can see, table in mysql_prepare_insert is *always* either table_list->table or NULL. At least in 10.5. So I'd rather remove the table argument completely and let mysql_prepare_insert always use table_list->table.
How so? There is no ALTER IF NOT EXISTS. And this is the old code, so it seems to be for CREATE TABLE IF NOT EXISTS.
Regards, Sergei VP of MariaDB Server Engineering and security@mariadb.org

Hi! On Sun, Oct 18, 2020 at 3:38 PM Sergei Golubchik <serg@mariadb.org> wrote:
Hi, Monty!
I prefer to have the first row readable and understandable for all possible readers, which the MDEV doesn't do. I can move the MDEV to the first row in this case, but if the commit touches several MDEV's, I will list these separately and keep the first row as a summary of what the commit is for.
The above explains it, as those the MDEV. It means that the slave is not up to date with the master (either intentionally with stop slave or because the slave still has local not-s3 tables as it has not yet seen ALTER TABLE ... engine=s3). The assumption is also that anyone reading the commit knows what 'slave' and 'master' and 'delayed slave' means <cut>
Binlog_drop_table() and binlog_create_table() calls binlog_query(), which always does a commit for any query events. <cut>
First a note. The function can be used anywhere where one would binlog the current query. The ..._local_stmt_filter() functions are only there to force the query to be logged statement based even if decide_logging_format(), used by some statement, would have wanted to do things differently. I have updated the function comment. I am not sure how many will understand the word 'unfiltered' I have expanded the function comment to explain this in more detail and also renamed the function binlog_current_query_unfiltered().
Proper place to have it at start. Not directly related to this patch.
Yes, this is correct. This is why 'retval' is set to is_error() above. res is only used to know if the binlog
So I don't think you need `retval= thd->is_error()` at all, and instead you need
if (res < 0) retval= thd->binlog_current_query();
Actually this is also wrong as it would reset 'result' if it was set by is_error() ;) I have changed it to: if (thd->binlog_current_query_unfiltered()) retval= 1;
I got crashes is result->prepared and got confused in the debugger that 'table' was not set. Better to set the table early instead of having it undefined for a longer amount of time.
So I'd rather remove the table argument completely and let mysql_prepare_insert always use table_list->table.
Agree that it's safe to remove the table argument. Will do that.
Alter table s3_table engine=innodb table, could come here. I added the comment to clarify this. Regards, Monty
participants (2)
-
Michael Widenius
-
Sergei Golubchik