Merge pull request #6336 from taosdata/fix/TD-3078
[TD-3078]<fix>: fix arbitrator create time
This commit is contained in:
commit
a51b1e5d88
|
@ -39,6 +39,7 @@ extern int8_t tsEnableTelemetryReporting;
|
||||||
extern char tsEmail[];
|
extern char tsEmail[];
|
||||||
extern char tsArbitrator[];
|
extern char tsArbitrator[];
|
||||||
extern int8_t tsArbOnline;
|
extern int8_t tsArbOnline;
|
||||||
|
extern int64_t tsArbOnlineTimestamp;
|
||||||
extern int32_t tsDnodeId;
|
extern int32_t tsDnodeId;
|
||||||
|
|
||||||
// common
|
// common
|
||||||
|
|
|
@ -42,6 +42,7 @@ int32_t tsNumOfMnodes = 3;
|
||||||
int8_t tsEnableVnodeBak = 1;
|
int8_t tsEnableVnodeBak = 1;
|
||||||
int8_t tsEnableTelemetryReporting = 1;
|
int8_t tsEnableTelemetryReporting = 1;
|
||||||
int8_t tsArbOnline = 0;
|
int8_t tsArbOnline = 0;
|
||||||
|
int64_t tsArbOnlineTimestamp = TSDB_ARB_DUMMY_TIME;
|
||||||
char tsEmail[TSDB_FQDN_LEN] = {0};
|
char tsEmail[TSDB_FQDN_LEN] = {0};
|
||||||
int32_t tsDnodeId = 0;
|
int32_t tsDnodeId = 0;
|
||||||
|
|
||||||
|
|
|
@ -373,6 +373,8 @@ do { \
|
||||||
|
|
||||||
#define TSDB_MAX_WAL_SIZE (1024*1024*3)
|
#define TSDB_MAX_WAL_SIZE (1024*1024*3)
|
||||||
|
|
||||||
|
#define TSDB_ARB_DUMMY_TIME 4765104000000 // 2121-01-01 00:00:00.000, :P
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
TAOS_QTYPE_RPC = 0,
|
TAOS_QTYPE_RPC = 0,
|
||||||
TAOS_QTYPE_FWD = 1,
|
TAOS_QTYPE_FWD = 1,
|
||||||
|
|
|
@ -941,7 +941,7 @@ static int32_t mnodeRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows, vo
|
||||||
cols++;
|
cols++;
|
||||||
|
|
||||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||||
*(int64_t *)pWrite = 0;
|
*(int64_t *)pWrite = tsArbOnlineTimestamp;
|
||||||
cols++;
|
cols++;
|
||||||
|
|
||||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||||
|
|
|
@ -1150,7 +1150,12 @@ static void syncSetupPeerConnection(SSyncPeer *pPeer) {
|
||||||
pPeer->peerFd = connFd;
|
pPeer->peerFd = connFd;
|
||||||
pPeer->role = TAOS_SYNC_ROLE_UNSYNCED;
|
pPeer->role = TAOS_SYNC_ROLE_UNSYNCED;
|
||||||
pPeer->pConn = syncAllocateTcpConn(tsTcpPool, pPeer->rid, connFd);
|
pPeer->pConn = syncAllocateTcpConn(tsTcpPool, pPeer->rid, connFd);
|
||||||
if (pPeer->isArb) tsArbOnline = 1;
|
if (pPeer->isArb) {
|
||||||
|
tsArbOnline = 1;
|
||||||
|
if (tsArbOnlineTimestamp == TSDB_ARB_DUMMY_TIME) {
|
||||||
|
tsArbOnlineTimestamp = taosGetTimestampMs();
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sDebug("%s, failed to setup peer connection to server since %s, try later", pPeer->id, strerror(errno));
|
sDebug("%s, failed to setup peer connection to server since %s, try later", pPeer->id, strerror(errno));
|
||||||
taosCloseSocket(connFd);
|
taosCloseSocket(connFd);
|
||||||
|
|
Loading…
Reference in New Issue