refactor(sync): add index/term in vnodeSnapWriterClose
This commit is contained in:
parent
fdf7930702
commit
604e5b750c
|
@ -116,11 +116,11 @@ int32_t metaTbCursorNext(SMTbCursor *pTbCur);
|
||||||
// typedef struct STsdb STsdb;
|
// typedef struct STsdb STsdb;
|
||||||
typedef struct STsdbReader STsdbReader;
|
typedef struct STsdbReader STsdbReader;
|
||||||
|
|
||||||
#define BLOCK_LOAD_OFFSET_ORDER 1
|
#define BLOCK_LOAD_OFFSET_ORDER 1
|
||||||
#define BLOCK_LOAD_TABLESEQ_ORDER 2
|
#define BLOCK_LOAD_TABLESEQ_ORDER 2
|
||||||
#define BLOCK_LOAD_EXTERN_ORDER 3
|
#define BLOCK_LOAD_EXTERN_ORDER 3
|
||||||
|
|
||||||
#define LASTROW_RETRIEVE_TYPE_ALL 0x1
|
#define LASTROW_RETRIEVE_TYPE_ALL 0x1
|
||||||
#define LASTROW_RETRIEVE_TYPE_SINGLE 0x2
|
#define LASTROW_RETRIEVE_TYPE_SINGLE 0x2
|
||||||
|
|
||||||
int32_t tsdbSetTableId(STsdbReader *pReader, int64_t uid);
|
int32_t tsdbSetTableId(STsdbReader *pReader, int64_t uid);
|
||||||
|
@ -191,7 +191,7 @@ int32_t vnodeSnapReaderClose(SVSnapReader *pReader);
|
||||||
int32_t vnodeSnapRead(SVSnapReader *pReader, uint8_t **ppData, uint32_t *nData);
|
int32_t vnodeSnapRead(SVSnapReader *pReader, uint8_t **ppData, uint32_t *nData);
|
||||||
// SVSnapWriter
|
// SVSnapWriter
|
||||||
int32_t vnodeSnapWriterOpen(SVnode *pVnode, int64_t sver, int64_t ever, SVSnapWriter **ppWriter);
|
int32_t vnodeSnapWriterOpen(SVnode *pVnode, int64_t sver, int64_t ever, SVSnapWriter **ppWriter);
|
||||||
int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback);
|
int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback, SSnapshot *pSnapshot);
|
||||||
int32_t vnodeSnapWrite(SVSnapWriter *pWriter, uint8_t *pData, uint32_t nData);
|
int32_t vnodeSnapWrite(SVSnapWriter *pWriter, uint8_t *pData, uint32_t nData);
|
||||||
|
|
||||||
// structs
|
// structs
|
||||||
|
@ -237,8 +237,8 @@ typedef struct {
|
||||||
uint64_t groupId;
|
uint64_t groupId;
|
||||||
} STableKeyInfo;
|
} STableKeyInfo;
|
||||||
|
|
||||||
#define TABLE_ROLLUP_ON ((int8_t)0x1)
|
#define TABLE_ROLLUP_ON ((int8_t)0x1)
|
||||||
#define TABLE_IS_ROLLUP(FLG) (((FLG) & (TABLE_ROLLUP_ON)) != 0)
|
#define TABLE_IS_ROLLUP(FLG) (((FLG) & (TABLE_ROLLUP_ON)) != 0)
|
||||||
#define TABLE_SET_ROLLUP(FLG) ((FLG) |= TABLE_ROLLUP_ON)
|
#define TABLE_SET_ROLLUP(FLG) ((FLG) |= TABLE_ROLLUP_ON)
|
||||||
struct SMetaEntry {
|
struct SMetaEntry {
|
||||||
int64_t version;
|
int64_t version;
|
||||||
|
|
|
@ -173,7 +173,7 @@ _err:
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback) {
|
int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback, SSnapshot *pSnapshot) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
|
||||||
if (pWriter->pMetaSnapWriter) {
|
if (pWriter->pMetaSnapWriter) {
|
||||||
|
|
|
@ -518,7 +518,7 @@ static int32_t vnodeSnapshotStartWrite(struct SSyncFSM *pFsm, void *pParam, void
|
||||||
static int32_t vnodeSnapshotStopWrite(struct SSyncFSM *pFsm, void *pWriter, bool isApply, SSnapshot *pSnapshot) {
|
static int32_t vnodeSnapshotStopWrite(struct SSyncFSM *pFsm, void *pWriter, bool isApply, SSnapshot *pSnapshot) {
|
||||||
#ifdef USE_TSDB_SNAPSHOT
|
#ifdef USE_TSDB_SNAPSHOT
|
||||||
SVnode *pVnode = pFsm->data;
|
SVnode *pVnode = pFsm->data;
|
||||||
int32_t code = vnodeSnapWriterClose(pWriter, !isApply);
|
int32_t code = vnodeSnapWriterClose(pWriter, !isApply, pSnapshot);
|
||||||
return code;
|
return code;
|
||||||
#else
|
#else
|
||||||
taosMemoryFree(pWriter);
|
taosMemoryFree(pWriter);
|
||||||
|
|
Loading…
Reference in New Issue