From 2889d1717c68efb32eade43b3a44af88a66996fe Mon Sep 17 00:00:00 2001 From: root <314218900@qq.com> Date: Mon, 13 Jun 2022 14:24:45 +0800 Subject: [PATCH] Failed to start TDengine server service.(vnode tsdb data file has wrong size , report to upper layer to fix it) #13529 --- docs-examples/python/subscribe_demo.py | 6 +++--- output.txt | 6 ++++++ src/tsdb/inc/tsdbFile.h | 3 +-- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 output.txt diff --git a/docs-examples/python/subscribe_demo.py b/docs-examples/python/subscribe_demo.py index db9d49c3f4..bb71a62344 100644 --- a/docs-examples/python/subscribe_demo.py +++ b/docs-examples/python/subscribe_demo.py @@ -27,12 +27,12 @@ def query_callback(p_sub, p_result, p_param, code): if __name__ == '__main__': - conn = taos.connect() + conn = taos.connect(host="192.168.0.101",user="root",password="taosdata") restart = True topic = "topic-meter-current-bg" - sql = "select * from power.meters where current > 10" # Error sql + sql = "select * from test.meters where current > 10" # Error sql interval = 2000 # consumption interval in microseconds. - _ = conn.subscribe(restart, topic, sql, interval, query_callback) + _ = conn.subscribe(restart, topic, sql, interval) # Note: we received the return value as _ above, to avoid the TaosSubscription object to be deleted by gc. while True: time.sleep(10) # use Ctrl + C to interrupt diff --git a/output.txt b/output.txt new file mode 100644 index 0000000000..a272350609 --- /dev/null +++ b/output.txt @@ -0,0 +1,6 @@ +[06/13 14:00:51.480051] INFO: start creating 100 table(s) with 8 thread(s) +Spent 0.2650 seconds to create 100 table(s) with 8 thread(s), already exist 0 table(s), actual 100 table(s) pre created, 0 table(s) will be auto created +Spent 0.0251 seconds to insert rows: 20000, affected rows: 20000 with 8 thread(s) into test 796527.14 records/second + +insert delay, min: 0.16ms, avg: 0.96ms, p90: 1.50ms, p95: 3.00ms, p99: 10.50ms, max: 10.50ms + diff --git a/src/tsdb/inc/tsdbFile.h b/src/tsdb/inc/tsdbFile.h index d753129548..6b275b31e9 100644 --- a/src/tsdb/inc/tsdbFile.h +++ b/src/tsdb/inc/tsdbFile.h @@ -260,9 +260,8 @@ static FORCE_INLINE int tsdbAppendDFile(SDFile* pDFile, void* buf, int64_t nbyte //bug fix. To avoid data corruption, //the end offset of current file should be checked with file size, //if not equal, known as file corrupted and return error. - //ASSERT(pDFile->info.size == toffset); if (pDFile->info.size != toffset) { - terrno = TAOS_SYSTEM_ERROR(TSDB_CODE_COM_FILE_CORRUPTED); + terrno = TSDB_CODE_TDB_FILE_CORRUPTED; return -1; } -- GitLab