TD-2270
This commit is contained in:
parent
1408a331f1
commit
26b32bd9e7
|
@ -566,8 +566,8 @@ int32_t bnInit() {
|
|||
|
||||
void bnCleanUp() {
|
||||
bnCleanupThread();
|
||||
pthread_mutex_destroy(&tsBnMgmt.mutex);
|
||||
bnCleanupDnodes();
|
||||
pthread_mutex_destroy(&tsBnMgmt.mutex);
|
||||
}
|
||||
|
||||
int32_t bnDropDnode(SDnodeObj *pDnode) {
|
||||
|
|
|
@ -81,7 +81,6 @@ void bnCleanupThread() {
|
|||
}
|
||||
|
||||
static void bnPostSignal() {
|
||||
mDebug("balance thread async notify");
|
||||
pthread_mutex_lock(&tsBnThread.mutex);
|
||||
pthread_cond_signal(&tsBnThread.cond);
|
||||
pthread_mutex_unlock(&(tsBnThread.mutex));
|
||||
|
@ -94,11 +93,13 @@ static void bnPostSignal() {
|
|||
|
||||
static void bnProcessTimer(void *handle, void *tmrId) {
|
||||
if (!sdbIsMaster()) return;
|
||||
if (tsBnThread.stop) return;
|
||||
|
||||
tsBnThread.timer = NULL;
|
||||
tsAccessSquence++;
|
||||
|
||||
bnCheckStatus();
|
||||
bnStartTimer(-1);
|
||||
|
||||
if (handle == NULL) {
|
||||
if (tsAccessSquence % tsBalanceInterval == 0) {
|
||||
|
@ -113,6 +114,8 @@ static void bnProcessTimer(void *handle, void *tmrId) {
|
|||
}
|
||||
|
||||
void bnStartTimer(int64_t mseconds) {
|
||||
if (tsBnThread.stop) return;
|
||||
|
||||
bool updateSoon = (mseconds != -1);
|
||||
if (updateSoon) {
|
||||
taosTmrReset(bnProcessTimer, mseconds, (void *)mseconds, tsMnodeTmr, &tsBnThread.timer);
|
||||
|
|
Loading…
Reference in New Issue