mirror of
https://github.com/ceph/ceph
synced 2025-03-30 15:31:01 +00:00
Merge pull request #994 from yuyuyu101/wip-7062
Fix WBThrottle thread disappear problem Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
commit
a39226ac9a
@ -1403,6 +1403,7 @@ int FileStore::mount()
|
||||
}
|
||||
}
|
||||
|
||||
wbthrottle.start();
|
||||
sync_thread.create();
|
||||
|
||||
ret = journal_replay(initial_op_seq);
|
||||
@ -1420,6 +1421,8 @@ int FileStore::mount()
|
||||
lock.Unlock();
|
||||
sync_thread.join();
|
||||
|
||||
wbthrottle.stop();
|
||||
|
||||
goto close_current_fd;
|
||||
}
|
||||
|
||||
@ -1469,6 +1472,7 @@ int FileStore::umount()
|
||||
sync_cond.Signal();
|
||||
lock.Unlock();
|
||||
sync_thread.join();
|
||||
wbthrottle.stop();
|
||||
op_tp.stop();
|
||||
|
||||
journal_stop();
|
||||
|
@ -10,7 +10,7 @@ WBThrottle::WBThrottle(CephContext *cct) :
|
||||
cur_ios(0), cur_size(0),
|
||||
cct(cct),
|
||||
logger(NULL),
|
||||
stopping(false),
|
||||
stopping(true),
|
||||
lock("WBThrottle::lock", false, true, false, cct),
|
||||
fs(XFS)
|
||||
{
|
||||
@ -34,20 +34,33 @@ WBThrottle::WBThrottle(CephContext *cct) :
|
||||
logger->set(i, 0);
|
||||
|
||||
cct->_conf->add_observer(this);
|
||||
create();
|
||||
}
|
||||
|
||||
WBThrottle::~WBThrottle() {
|
||||
assert(cct);
|
||||
cct->get_perfcounters_collection()->remove(logger);
|
||||
delete logger;
|
||||
cct->_conf->remove_observer(this);
|
||||
}
|
||||
|
||||
void WBThrottle::start()
|
||||
{
|
||||
{
|
||||
Mutex::Locker l(lock);
|
||||
stopping = false;
|
||||
}
|
||||
create();
|
||||
}
|
||||
|
||||
void WBThrottle::stop()
|
||||
{
|
||||
{
|
||||
Mutex::Locker l(lock);
|
||||
stopping = true;
|
||||
cond.Signal();
|
||||
}
|
||||
|
||||
join();
|
||||
cct->get_perfcounters_collection()->remove(logger);
|
||||
delete logger;
|
||||
cct->_conf->remove_observer(this);
|
||||
}
|
||||
|
||||
const char** WBThrottle::get_tracked_conf_keys() const
|
||||
|
@ -134,6 +134,7 @@ public:
|
||||
WBThrottle(CephContext *cct);
|
||||
~WBThrottle();
|
||||
|
||||
void stop();
|
||||
/// Set fs as XFS or BTRFS
|
||||
void set_fs(FS new_fs) {
|
||||
Mutex::Locker l(lock);
|
||||
|
Loading…
Reference in New Issue
Block a user