mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
Adjusting locks for concurrency issue (not found, but suspect).
storage/archive/ha_archive.cc: Adjusted lock positions to handle possible concurrency condition
This commit is contained in:
parent
e02aa04721
commit
aaef396b5a
1 changed files with 3 additions and 3 deletions
|
@ -1003,7 +1003,6 @@ int ha_archive::rnd_init(bool scan)
|
|||
/* We rewind the file so that we can read from the beginning if scan */
|
||||
if (scan)
|
||||
{
|
||||
scan_rows= share->rows_recorded;
|
||||
DBUG_PRINT("info", ("archive will retrieve %llu rows",
|
||||
(unsigned long long) scan_rows));
|
||||
stats.records= 0;
|
||||
|
@ -1012,17 +1011,18 @@ int ha_archive::rnd_init(bool scan)
|
|||
If dirty, we lock, and then reset/flush the data.
|
||||
I found that just calling azflush() doesn't always work.
|
||||
*/
|
||||
pthread_mutex_lock(&share->mutex);
|
||||
scan_rows= share->rows_recorded;
|
||||
if (share->dirty == TRUE)
|
||||
{
|
||||
pthread_mutex_lock(&share->mutex);
|
||||
if (share->dirty == TRUE)
|
||||
{
|
||||
DBUG_PRINT("ha_archive", ("archive flushing out rows for scan"));
|
||||
azflush(&(share->archive_write), Z_SYNC_FLUSH);
|
||||
share->dirty= FALSE;
|
||||
}
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
}
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
|
||||
if (read_data_header(&archive))
|
||||
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
|
||||
|
|
Loading…
Add table
Reference in a new issue