Merge pull request #5639 from taosdata/feature/linux
remove FResetVersion function
This commit is contained in:
commit
24f134f421
|
@ -259,7 +259,7 @@ do { \
|
||||||
#define TSDB_MIN_TABLES 4
|
#define TSDB_MIN_TABLES 4
|
||||||
#define TSDB_MAX_TABLES 10000000
|
#define TSDB_MAX_TABLES 10000000
|
||||||
#define TSDB_DEFAULT_TABLES 1000000
|
#define TSDB_DEFAULT_TABLES 1000000
|
||||||
#define TSDB_TABLES_STEP 100
|
#define TSDB_TABLES_STEP 1000
|
||||||
|
|
||||||
#define TSDB_MIN_DAYS_PER_FILE 1
|
#define TSDB_MIN_DAYS_PER_FILE 1
|
||||||
#define TSDB_MAX_DAYS_PER_FILE 3650
|
#define TSDB_MAX_DAYS_PER_FILE 3650
|
||||||
|
|
|
@ -79,9 +79,6 @@ typedef void (*FStopSyncFile)(int32_t vgId, uint64_t fversion);
|
||||||
// get file version
|
// get file version
|
||||||
typedef int32_t (*FGetVersion)(int32_t vgId, uint64_t *fver, uint64_t *vver);
|
typedef int32_t (*FGetVersion)(int32_t vgId, uint64_t *fver, uint64_t *vver);
|
||||||
|
|
||||||
// reset version
|
|
||||||
typedef int32_t (*FResetVersion)(int32_t vgId, uint64_t fver);
|
|
||||||
|
|
||||||
typedef int32_t (*FSendFile)(void *tsdb, SOCKET socketFd);
|
typedef int32_t (*FSendFile)(void *tsdb, SOCKET socketFd);
|
||||||
typedef int32_t (*FRecvFile)(void *tsdb, SOCKET socketFd);
|
typedef int32_t (*FRecvFile)(void *tsdb, SOCKET socketFd);
|
||||||
|
|
||||||
|
@ -99,7 +96,6 @@ typedef struct {
|
||||||
FStartSyncFile startSyncFileFp;
|
FStartSyncFile startSyncFileFp;
|
||||||
FStopSyncFile stopSyncFileFp;
|
FStopSyncFile stopSyncFileFp;
|
||||||
FGetVersion getVersionFp;
|
FGetVersion getVersionFp;
|
||||||
FResetVersion resetVersionFp;
|
|
||||||
FSendFile sendFileFp;
|
FSendFile sendFileFp;
|
||||||
FRecvFile recvFileFp;
|
FRecvFile recvFileFp;
|
||||||
} SSyncInfo;
|
} SSyncInfo;
|
||||||
|
|
|
@ -117,7 +117,6 @@ typedef struct SSyncNode {
|
||||||
FStartSyncFile startSyncFileFp;
|
FStartSyncFile startSyncFileFp;
|
||||||
FStopSyncFile stopSyncFileFp;
|
FStopSyncFile stopSyncFileFp;
|
||||||
FGetVersion getVersionFp;
|
FGetVersion getVersionFp;
|
||||||
FResetVersion resetVersionFp;
|
|
||||||
FSendFile sendFileFp;
|
FSendFile sendFileFp;
|
||||||
FRecvFile recvFileFp;
|
FRecvFile recvFileFp;
|
||||||
pthread_mutex_t mutex;
|
pthread_mutex_t mutex;
|
||||||
|
|
|
@ -182,7 +182,6 @@ int64_t syncStart(const SSyncInfo *pInfo) {
|
||||||
pNode->startSyncFileFp = pInfo->startSyncFileFp;
|
pNode->startSyncFileFp = pInfo->startSyncFileFp;
|
||||||
pNode->stopSyncFileFp = pInfo->stopSyncFileFp;
|
pNode->stopSyncFileFp = pInfo->stopSyncFileFp;
|
||||||
pNode->getVersionFp = pInfo->getVersionFp;
|
pNode->getVersionFp = pInfo->getVersionFp;
|
||||||
pNode->resetVersionFp = pInfo->resetVersionFp;
|
|
||||||
pNode->sendFileFp = pInfo->sendFileFp;
|
pNode->sendFileFp = pInfo->sendFileFp;
|
||||||
pNode->recvFileFp = pInfo->recvFileFp;
|
pNode->recvFileFp = pInfo->recvFileFp;
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,6 @@ static int32_t syncRestoreDataStepByStep(SSyncPeer *pPeer) {
|
||||||
|
|
||||||
(*pNode->stopSyncFileFp)(pNode->vgId, fversion);
|
(*pNode->stopSyncFileFp)(pNode->vgId, fversion);
|
||||||
nodeVersion = fversion;
|
nodeVersion = fversion;
|
||||||
if (pNode->resetVersionFp) (*pNode->resetVersionFp)(pNode->vgId, fversion);
|
|
||||||
|
|
||||||
sInfo("%s, start to restore wal, fver:%" PRIu64, pPeer->id, nodeVersion);
|
sInfo("%s, start to restore wal, fver:%" PRIu64, pPeer->id, nodeVersion);
|
||||||
uint64_t wver = 0;
|
uint64_t wver = 0;
|
||||||
|
|
|
@ -30,7 +30,6 @@ void vnodeStopSyncFile(int32_t vgId, uint64_t fversion);
|
||||||
void vnodeConfirmForard(int32_t vgId, void *wparam, int32_t code);
|
void vnodeConfirmForard(int32_t vgId, void *wparam, int32_t code);
|
||||||
int32_t vnodeWriteToCache(int32_t vgId, void *wparam, int32_t qtype, void *rparam);
|
int32_t vnodeWriteToCache(int32_t vgId, void *wparam, int32_t qtype, void *rparam);
|
||||||
int32_t vnodeGetVersion(int32_t vgId, uint64_t *fver, uint64_t *wver);
|
int32_t vnodeGetVersion(int32_t vgId, uint64_t *fver, uint64_t *wver);
|
||||||
int32_t vnodeResetVersion(int32_t vgId, uint64_t fver);
|
|
||||||
|
|
||||||
void vnodeConfirmForward(void *pVnode, uint64_t version, int32_t code, bool force);
|
void vnodeConfirmForward(void *pVnode, uint64_t version, int32_t code, bool force);
|
||||||
|
|
||||||
|
|
|
@ -364,7 +364,6 @@ int32_t vnodeOpen(int32_t vgId) {
|
||||||
syncInfo.startSyncFileFp = vnodeStartSyncFile;
|
syncInfo.startSyncFileFp = vnodeStartSyncFile;
|
||||||
syncInfo.stopSyncFileFp = vnodeStopSyncFile;
|
syncInfo.stopSyncFileFp = vnodeStopSyncFile;
|
||||||
syncInfo.getVersionFp = vnodeGetVersion;
|
syncInfo.getVersionFp = vnodeGetVersion;
|
||||||
syncInfo.resetVersionFp = vnodeResetVersion;
|
|
||||||
syncInfo.sendFileFp = tsdbSyncSend;
|
syncInfo.sendFileFp = tsdbSyncSend;
|
||||||
syncInfo.recvFileFp = tsdbSyncRecv;
|
syncInfo.recvFileFp = tsdbSyncRecv;
|
||||||
syncInfo.pTsdb = pVnode->tsdb;
|
syncInfo.pTsdb = pVnode->tsdb;
|
||||||
|
|
|
@ -107,8 +107,9 @@ void vnodeStopSyncFile(int32_t vgId, uint64_t fversion) {
|
||||||
pVnode->fversion = fversion;
|
pVnode->fversion = fversion;
|
||||||
pVnode->version = fversion;
|
pVnode->version = fversion;
|
||||||
vnodeSaveVersion(pVnode);
|
vnodeSaveVersion(pVnode);
|
||||||
|
walResetVersion(pVnode->wal, fversion);
|
||||||
|
|
||||||
vDebug("vgId:%d, datafile is synced, fver:%" PRIu64 " vver:%" PRIu64, vgId, fversion, fversion);
|
vInfo("vgId:%d, datafile is synced, fver:%" PRIu64 " vver:%" PRIu64, vgId, fversion, fversion);
|
||||||
vnodeSetReadyStatus(pVnode);
|
vnodeSetReadyStatus(pVnode);
|
||||||
|
|
||||||
vnodeRelease(pVnode);
|
vnodeRelease(pVnode);
|
||||||
|
@ -158,22 +159,6 @@ int32_t vnodeGetVersion(int32_t vgId, uint64_t *fver, uint64_t *wver) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t vnodeResetVersion(int32_t vgId, uint64_t fver) {
|
|
||||||
SVnodeObj *pVnode = vnodeAcquire(vgId);
|
|
||||||
if (pVnode == NULL) {
|
|
||||||
vError("vgId:%d, vnode not found while reset version", vgId);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
pVnode->fversion = fver;
|
|
||||||
pVnode->version = fver;
|
|
||||||
walResetVersion(pVnode->wal, fver);
|
|
||||||
vInfo("vgId:%d, version reset to %" PRIu64, vgId, fver);
|
|
||||||
|
|
||||||
vnodeRelease(pVnode);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void vnodeConfirmForward(void *vparam, uint64_t version, int32_t code, bool force) {
|
void vnodeConfirmForward(void *vparam, uint64_t version, int32_t code, bool force) {
|
||||||
SVnodeObj *pVnode = vparam;
|
SVnodeObj *pVnode = vparam;
|
||||||
syncConfirmForward(pVnode->sync, version, code, force);
|
syncConfirmForward(pVnode->sync, version, code, force);
|
||||||
|
|
Loading…
Reference in New Issue