Merge pull request #29594 from taosdata/fix/insert-when-2-replicas
fix/insert-when-2-replicas
This commit is contained in:
commit
a059e78c6c
|
@ -3428,7 +3428,8 @@ _out:;
|
||||||
ths->pLogBuf->matchIndex, ths->pLogBuf->endIndex);
|
ths->pLogBuf->matchIndex, ths->pLogBuf->endIndex);
|
||||||
|
|
||||||
if (code == 0 && ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) {
|
if (code == 0 && ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) {
|
||||||
TAOS_CHECK_RETURN(syncNodeUpdateAssignedCommitIndex(ths, matchIndex));
|
int64_t index = syncNodeUpdateAssignedCommitIndex(ths, matchIndex);
|
||||||
|
sTrace("vgId:%d, update assigned commit index %" PRId64 "", ths->vgId, index);
|
||||||
|
|
||||||
if (ths->fsmState != SYNC_FSM_STATE_INCOMPLETE &&
|
if (ths->fsmState != SYNC_FSM_STATE_INCOMPLETE &&
|
||||||
syncLogBufferCommit(ths->pLogBuf, ths, ths->assignedCommitIndex) < 0) {
|
syncLogBufferCommit(ths->pLogBuf, ths, ths->assignedCommitIndex) < 0) {
|
||||||
|
|
|
@ -35,6 +35,12 @@ class TDTestCase(TBase):
|
||||||
|
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
tdSql.execute("use db;")
|
||||||
|
|
||||||
|
tdSql.execute("CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int);")
|
||||||
|
|
||||||
|
tdSql.execute("CREATE TABLE d0 USING meters TAGS (\"California.SanFrancisco\", 2);");
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
while count < 100:
|
while count < 100:
|
||||||
|
@ -72,6 +78,8 @@ class TDTestCase(TBase):
|
||||||
|
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
|
tdSql.execute("INSERT INTO d0 VALUES (NOW, 10.3, 219, 0.31);")
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
tdSql.close()
|
tdSql.close()
|
||||||
tdLog.success(f"{__file__} successfully executed")
|
tdLog.success(f"{__file__} successfully executed")
|
||||||
|
|
Loading…
Reference in New Issue