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