Ingo,
I have approved this patch pending a minor request to change a comment in
the code.
> 2664 Ingo Struewing 2008-07-14
> Bug#38108 - Race condition in MyISAM backup driver
...
>
> A race condition between two or more running restore
> operations could leave the
> global variable 'myisam_single_user' in an undefined state.
Good that you guys caught this and fixed it. I am sure Rafal has pointed out
that we only allow one restore/backup to run at a time (currently). But it
is always good to fix race conditions!
...
> +/**
> + Read state info from file.
> +
> + @param[in] file index file descriptor
> + @param[in,out] state state info to update from file
> + @param[in] pRead if to use my_pread() instaed
> of my_read()
> + @param[in] force force read
> +
> + @return status
> + @retval 0 ok
> + @retval 1 error
> +
> + Normally this function does not read the state info from file if
> + 'myisam_single_user' is true. This means that mysqld is the only
> + program that works on the table files. No other program
> modifies the
> + files. Hence the in-memory state is expected to be current.
> +
> + If there are other programs tampering with the files,
> mysqld must be
> + started with --external-locking. This makes 'myisam_single_user'
> + false. In this case this function does indeed read the state from
> + disk.
> +
> + In cases like online restore, we modify the table files directly,
> + bypassing the MyISAM interface. We do this inside of mysqld, so
> + --external-locking need not be specified. We support this
> case by the
> + 'force' parameter.
> +*/
We don't have online restore. Please use simply 'restore' or 'mysql
restore'. This will help keep confusion to a minimum. ;)
Chuck