resolve conflict
This commit is contained in:
parent
123090e18a
commit
9a99b8526d
|
@ -275,17 +275,11 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
|
||||||
req.vgId, TMSG_INFO(pMsg->msgType), req.pages, req.pageSize, req.buffer, req.pageSize * 1024,
|
req.vgId, TMSG_INFO(pMsg->msgType), req.pages, req.pageSize, req.buffer, req.pageSize * 1024,
|
||||||
(uint64_t)req.buffer * 1024 * 1024, req.cacheLast, req.cacheLastSize, req.sstTrigger, req.tsdbPageSize,
|
(uint64_t)req.buffer * 1024 * 1024, req.cacheLast, req.cacheLastSize, req.sstTrigger, req.tsdbPageSize,
|
||||||
req.tsdbPageSize * 1024, req.db, req.dbUid, req.daysPerFile, req.daysToKeep0, req.daysToKeep1, req.daysToKeep2,
|
req.tsdbPageSize * 1024, req.db, req.dbUid, req.daysPerFile, req.daysToKeep0, req.daysToKeep1, req.daysToKeep2,
|
||||||
<<<<<<< HEAD
|
|
||||||
req.keepTimeOffset, req.isTsma, req.precision, req.compression, req.minRows, req.maxRows, req.walFsyncPeriod,
|
|
||||||
req.walLevel, req.walRetentionPeriod, req.walRetentionSize, req.walRollPeriod, req.walSegmentSize, req.hashMethod,
|
|
||||||
req.hashBegin, req.hashEnd, req.hashPrefix, req.hashSuffix, req.replica, req.selfIndex, req.learnerReplica,
|
|
||||||
req.learnerSelfIndex, req.strict, req.changeVersion, req.encryptAlgorithm);
|
|
||||||
=======
|
|
||||||
req.keepTimeOffset, req.s3ChunkSize, req.s3KeepLocal, req.s3Compact, req.isTsma, req.precision, req.compression,
|
req.keepTimeOffset, req.s3ChunkSize, req.s3KeepLocal, req.s3Compact, req.isTsma, req.precision, req.compression,
|
||||||
req.minRows, req.maxRows, req.walFsyncPeriod, req.walLevel, req.walRetentionPeriod, req.walRetentionSize,
|
req.minRows, req.maxRows, req.walFsyncPeriod, req.walLevel, req.walRetentionPeriod, req.walRetentionSize,
|
||||||
req.walRollPeriod, req.walSegmentSize, req.hashMethod, req.hashBegin, req.hashEnd, req.hashPrefix, req.hashSuffix,
|
req.walRollPeriod, req.walSegmentSize, req.hashMethod, req.hashBegin, req.hashEnd, req.hashPrefix, req.hashSuffix,
|
||||||
req.replica, req.selfIndex, req.learnerReplica, req.learnerSelfIndex, req.strict, req.changeVersion);
|
req.replica, req.selfIndex, req.learnerReplica, req.learnerSelfIndex, req.strict, req.changeVersion,
|
||||||
>>>>>>> 3.0
|
req.encryptAlgorithm);
|
||||||
|
|
||||||
for (int32_t i = 0; i < req.replica; ++i) {
|
for (int32_t i = 0; i < req.replica; ++i) {
|
||||||
dInfo("vgId:%d, replica:%d ep:%s:%u dnode:%d", req.vgId, i, req.replicas[i].fqdn, req.replicas[i].port,
|
dInfo("vgId:%d, replica:%d ep:%s:%u dnode:%d", req.vgId, i, req.replicas[i].fqdn, req.replicas[i].port,
|
||||||
|
|
|
@ -471,16 +471,10 @@ int32_t tsdbDataFileReadBlockDataByColumn(SDataFileReader *reader, const SBrinRe
|
||||||
char* encryptKey = reader->config->tsdb->pVnode->config.tsdbCfg.encryptKey;
|
char* encryptKey = reader->config->tsdb->pVnode->config.tsdbCfg.encryptKey;
|
||||||
// load from file
|
// load from file
|
||||||
tBufferClear(buffer1);
|
tBufferClear(buffer1);
|
||||||
<<<<<<< HEAD
|
|
||||||
code = tsdbReadFileToBuffer(reader->fd[TSDB_FTYPE_DATA],
|
|
||||||
record->blockOffset + record->blockKeySize + hdr.szBlkCol + blockCol.offset,
|
|
||||||
blockCol.szBitmap + blockCol.szOffset + blockCol.szValue, buffer1, 0,
|
|
||||||
encryptAlgorithm, encryptKey);
|
|
||||||
=======
|
|
||||||
code = tsdbReadFileToBuffer(
|
code = tsdbReadFileToBuffer(
|
||||||
reader->fd[TSDB_FTYPE_DATA], record->blockOffset + record->blockKeySize + hdr.szBlkCol + blockCol.offset,
|
reader->fd[TSDB_FTYPE_DATA], record->blockOffset + record->blockKeySize + hdr.szBlkCol + blockCol.offset,
|
||||||
blockCol.szBitmap + blockCol.szOffset + blockCol.szValue, buffer1, firstRead ? szHint : 0);
|
blockCol.szBitmap + blockCol.szOffset + blockCol.szValue, buffer1, firstRead ? szHint : 0,
|
||||||
>>>>>>> 3.0
|
encryptAlgorithm, encryptKey);
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
|
||||||
firstRead = false;
|
firstRead = false;
|
||||||
|
|
|
@ -15,11 +15,8 @@
|
||||||
|
|
||||||
#include "cos.h"
|
#include "cos.h"
|
||||||
#include "tsdb.h"
|
#include "tsdb.h"
|
||||||
<<<<<<< HEAD
|
|
||||||
#include "crypt.h"
|
#include "crypt.h"
|
||||||
=======
|
|
||||||
#include "vnd.h"
|
#include "vnd.h"
|
||||||
>>>>>>> 3.0
|
|
||||||
|
|
||||||
static int32_t tsdbOpenFileImpl(STsdbFD *pFD) {
|
static int32_t tsdbOpenFileImpl(STsdbFD *pFD) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
@ -285,41 +282,6 @@ static int32_t tsdbReadFilePage(STsdbFD *pFD, int64_t pgno, int32_t encryptAlgor
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
// read
|
|
||||||
n = taosReadFile(pFD->pFD, pFD->pBuf, pFD->szPage);
|
|
||||||
if (n < 0) {
|
|
||||||
code = TAOS_SYSTEM_ERROR(errno);
|
|
||||||
goto _exit;
|
|
||||||
} else if (n < pFD->szPage) {
|
|
||||||
code = TSDB_CODE_FILE_CORRUPTED;
|
|
||||||
goto _exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(encryptAlgorithm == DND_CA_SM4){
|
|
||||||
//if(tsiEncryptAlgorithm == DND_CA_SM4 && (tsiEncryptScope & DND_CS_TSDB) == DND_CS_TSDB){
|
|
||||||
unsigned char PacketData[128];
|
|
||||||
int NewLen;
|
|
||||||
|
|
||||||
int32_t count = 0;
|
|
||||||
while(count < pFD->szPage)
|
|
||||||
{
|
|
||||||
SCryptOpts opts = {0};
|
|
||||||
opts.len = 128;
|
|
||||||
opts.source = pFD->pBuf + count;
|
|
||||||
opts.result = PacketData;
|
|
||||||
opts.unitLen = 128;
|
|
||||||
//strncpy(opts.key, tsEncryptKey, 16);
|
|
||||||
strncpy(opts.key, encryptKey, ENCRYPT_KEY_LEN);
|
|
||||||
|
|
||||||
NewLen = CBC_Decrypt(&opts);
|
|
||||||
|
|
||||||
memcpy(pFD->pBuf + count, PacketData, NewLen);
|
|
||||||
count += NewLen;
|
|
||||||
}
|
|
||||||
//tsdbDebug("CBC_Decrypt count:%d %s", count, __FUNCTION__);
|
|
||||||
}
|
|
||||||
=======
|
|
||||||
// read
|
// read
|
||||||
n = taosReadFile(pFD->pFD, pFD->pBuf, pFD->szPage);
|
n = taosReadFile(pFD->pFD, pFD->pBuf, pFD->szPage);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
|
@ -328,10 +290,33 @@ static int32_t tsdbReadFilePage(STsdbFD *pFD, int64_t pgno, int32_t encryptAlgor
|
||||||
} else if (n < pFD->szPage) {
|
} else if (n < pFD->szPage) {
|
||||||
code = TSDB_CODE_FILE_CORRUPTED;
|
code = TSDB_CODE_FILE_CORRUPTED;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
>>>>>>> 3.0
|
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
if(encryptAlgorithm == DND_CA_SM4){
|
||||||
|
//if(tsiEncryptAlgorithm == DND_CA_SM4 && (tsiEncryptScope & DND_CS_TSDB) == DND_CS_TSDB){
|
||||||
|
unsigned char PacketData[128];
|
||||||
|
int NewLen;
|
||||||
|
|
||||||
|
int32_t count = 0;
|
||||||
|
while(count < pFD->szPage)
|
||||||
|
{
|
||||||
|
SCryptOpts opts = {0};
|
||||||
|
opts.len = 128;
|
||||||
|
opts.source = pFD->pBuf + count;
|
||||||
|
opts.result = PacketData;
|
||||||
|
opts.unitLen = 128;
|
||||||
|
//strncpy(opts.key, tsEncryptKey, 16);
|
||||||
|
strncpy(opts.key, encryptKey, ENCRYPT_KEY_LEN);
|
||||||
|
|
||||||
|
NewLen = CBC_Decrypt(&opts);
|
||||||
|
|
||||||
|
memcpy(pFD->pBuf + count, PacketData, NewLen);
|
||||||
|
count += NewLen;
|
||||||
|
}
|
||||||
|
//tsdbDebug("CBC_Decrypt count:%d %s", count, __FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
// check
|
// check
|
||||||
if (pgno > 1 && !taosCheckChecksumWhole(pFD->pBuf, pFD->szPage)) {
|
if (pgno > 1 && !taosCheckChecksumWhole(pFD->pBuf, pFD->szPage)) {
|
||||||
code = TSDB_CODE_FILE_CORRUPTED;
|
code = TSDB_CODE_FILE_CORRUPTED;
|
||||||
|
@ -624,12 +609,8 @@ int32_t tsdbFsyncFile(STsdbFD *pFD, int32_t encryptAlgorithm, char* encryptKey)
|
||||||
tsdbWarn("%s file: %s", __func__, pFD->path);
|
tsdbWarn("%s file: %s", __func__, pFD->path);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
code = tsdbWriteFilePage(pFD, encryptAlgorithm, encryptKey);
|
|
||||||
=======
|
|
||||||
*/
|
*/
|
||||||
code = tsdbWriteFilePage(pFD);
|
code = tsdbWriteFilePage(pFD, encryptAlgorithm, encryptKey);
|
||||||
>>>>>>> 3.0
|
|
||||||
if (code) goto _exit;
|
if (code) goto _exit;
|
||||||
|
|
||||||
if (taosFsyncFile(pFD->pFD) < 0) {
|
if (taosFsyncFile(pFD->pFD) < 0) {
|
||||||
|
|
Loading…
Reference in New Issue