From b0f2738ebe0c9b6c79506dcd0826fc47a1aabc8f Mon Sep 17 00:00:00 2001 From: slguan Date: Tue, 26 Nov 2019 19:10:40 +0800 Subject: [PATCH] [TBASE-1229] --- src/sdb/src/sdbEngine.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/sdb/src/sdbEngine.c b/src/sdb/src/sdbEngine.c index adb3e48bc7..f459def1fc 100644 --- a/src/sdb/src/sdbEngine.c +++ b/src/sdb/src/sdbEngine.c @@ -353,8 +353,18 @@ int64_t sdbInsertRow(void *handle, void *row, int rowSize) { if ((pTable->keyType != SDB_KEYTYPE_AUTO) || *((int64_t *)row)) if (sdbGetRow(handle, row)) { - sdbError("table:%s, failed to insert record", pTable->name); - return -1; + if (strcmp(pTable->name, "mnode") == 0) { + /* + * An mnode is created when the cluster is started, so conflicts may occur during synchronization. + * In this case, the version is still increased. + */ + sdbVersion++; + sdbPrint("table:%s, failed to insert record to mnodes, sdbVersion:%d", pTable->name, sdbVersion); + return -1; + } else { + sdbError("table:%s, failed to insert record, sdbVersion:%d", pTable->name, sdbVersion); + return -1; + } } total_size = sizeof(SRowHead) + pTable->maxRowSize + sizeof(TSCKSUM); -- GitLab