mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Fix race condition: instance map wasn't locked for the
duration of the whole 'flush instances'. As a consequence, it was possible to query instance map, while it is in the inconsistent state. The patch was reworked after review. server-tools/instance-manager/guardian.cc: do not lock instance map in Guardian_thread::init() server-tools/instance-manager/instance_map.cc: Eliminate race condition: lock instance map and guardian for the duration of the whole "FLUSH INSTANCES" execution. server-tools/instance-manager/instance_map.h: add new method. cleanup interface. add comments. server-tools/instance-manager/manager.cc: use instance_map.flush_instances instead of instance_map.load() and guardian_thread.init()
This commit is contained in:
@ -256,7 +256,6 @@ int Guardian_thread::init()
|
||||
Instance *instance;
|
||||
Instance_map::Iterator iterator(instance_map);
|
||||
|
||||
instance_map->lock();
|
||||
/* clear the list of guarded instances */
|
||||
free_root(&alloc, MYF(0));
|
||||
init_alloc_root(&alloc, MEM_ROOT_BLOCK_SIZE, 0);
|
||||
@ -272,7 +271,6 @@ int Guardian_thread::init()
|
||||
}
|
||||
}
|
||||
|
||||
instance_map->unlock();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user