OS: CentOS7.3
TiDB:4.0
使用sysbench oltp_update_index场景压测,到128并发时,报错写入冲突。
并且压测前已经设置了全局变量:
set global tidb_disable_txn_auto_retry = off;
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 128
Report intermediate results every 10 second(s)
Initializing random number generator from current time
Initializing worker threads…
Threads started!
[ 10s ] thds: 128 tps: 771.32 qps: 771.32 (r/w/o: 0.00/771.32/0.00) lat (ms,95%): 176.73 err/s: 0.00 reconn/s: 0.00
[ 20s ] thds: 128 tps: 649.30 qps: 649.30 (r/w/o: 0.00/649.30/0.00) lat (ms,95%): 308.84 err/s: 0.00 reconn/s: 0.00
[ 30s ] thds: 128 tps: 680.50 qps: 680.50 (r/w/o: 0.00/680.50/0.00) lat (ms,95%): 186.54 err/s: 0.00 reconn/s: 0.00
[ 40s ] thds: 128 tps: 556.80 qps: 556.80 (r/w/o: 0.00/556.80/0.00) lat (ms,95%): 179.94 err/s: 0.00 reconn/s: 0.00
[ 50s ] thds: 128 tps: 708.20 qps: 708.20 (r/w/o: 0.00/708.20/0.00) lat (ms,95%): 170.48 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: 128 tps: 750.25 qps: 750.25 (r/w/o: 0.00/750.25/0.00) lat (ms,95%): 183.21 err/s: 0.00 reconn/s: 0.00
[ 70s ] thds: 128 tps: 452.67 qps: 452.67 (r/w/o: 0.00/452.67/0.00) lat (ms,95%): 142.39 err/s: 0.00 reconn/s: 0.00
FATAL: mysql_stmt_execute() returned error 9007 (Write conflict, txnStartTS=417406711560405230, conflictStartTS=417406711560405163, conflictCommitTS=417406712477908998, key={tableID=245, indexID=1, indexValues={30729, 5008, }} primary={tableID=245, indexID=1, indexValues={30729, 5008, }} [try again later]) for query ‘UPDATE sbtest1 SET k=k+1 WHERE id=?’
FATAL: thread_run' function failed: ./oltp_common.lua:465: SQL error, errno = 9007, state = 'HY000': Write conflict, txnStartTS=417406711560405230, conflictStartTS=417406711560405163, conflictCommitTS=417406712477908998, key={tableID=245, indexID=1, indexValues={30729, 5008, }} primary={tableID=245, indexID=1, indexValues={30729, 5008, }} [try again later] FATAL: mysql_stmt_execute() returned error 9007 (Write conflict, txnStartTS=417406712504123404, conflictStartTS=417406712504123402, conflictCommitTS=417406712504123405, key={tableID=245, handle=5008} primary={tableID=245, indexID=1, indexValues={30732, 5008, }} [try again later]) for query 'UPDATE sbtest1 SET k=k+1 WHERE id=?' FATAL:
thread_run’ function failed: ./oltp_common.lua:465: SQL error, errno = 9007, state = ‘HY000’: Write conflict, txnStartTS=417406712504123404, conflictStartTS=417406712504123402, conflictCommitTS=417406712504123405, key={tableID=245, handle=5008} primary={tableID=245, indexID=1, indexValues={30732, 5008, }} [try again later]
FATAL: mysql_stmt_execute() returned error 9007 (Write conflict, txnStartTS=417406712595873795, conflictStartTS=417406712595873794, conflictCommitTS=417406712595873796, key={tableID=245, indexID=1, indexValues={30755, 5008, }} primary={tableID=245, indexID=1, indexValues={30755, 5008, }} [try again later]) for query ‘UPDATE sbtest1 SET k=k+1 WHERE id=?’
FATAL: `thread_run’ function failed: ./oltp_common.lua:465: SQL error, errno = 9007, state = ‘HY000’: Write conflict, txnStartTS=417406712595873795, conflictStartTS=417406712595873794, conflictCommitTS=417406712595873796, key={tableID=245, indexID=1, indexValues={30755, 5008, }} primary={tableID=245, indexID=1, indexValues={30755, 5008, }} [try again later]