Open jaki opened 4 years ago
Here is an easy way to reproduce this:
./bin/ysqlsh -c "CREATE TABLE p (i int PRIMARY KEY); INSERT INTO p VALUES (1), (2), (3);"
./bin/ysqlsh -c "SELECT * FROM p FOR UPDATE;"
for i in $(seq 1 100); do ./bin/ysqlsh -c "BEGIN; SELECT * FROM p FOR UPDATE; COMMIT;" &; done
./bin/ysqlsh -c "SELECT * FROM p FOR SHARE;"
Execute each of the statements with some time apart from each other. The last SELECT
should have a lot of aborted transactions in the transaction_
vector, visible by
VLOG(4) << context_.ToString() << ", aborted: " << transaction.id;
Jira Link: DB-1855 The
transaction_
vector inconflict_manager.cc
keeps growing in size under a certain circumstance.Setup:
Session A:
Session B:
Alternate statements from each session quickly. If they are done quickly enough, the error "Conflicts with higher priority transaction" sometimes appears (otherwise, you get "Value write after transaction start"). The more these errors occur, the larger the
transaction_
vector gets holding uncommitted transactions. It is not expected for this accumulation to happen. Even after closing both sessions, there is no cleanup.