Subject: | bug in cursor lock |
Date: | Mon, 05 Jun 2017 13:32:34 +0300 |
To: | bug-berkeleydb [...] rt.cpan.org |
From: | Алексей Белоус <aliaksei-belaus [...] yandex.ru> |
Hello, I have found an error which can lead to deadlock of berkley db. main.cpp file has code how to reproduce it. It was reproduced in 6.0.20 version.
The problem here is that after call of
ret = db_cursor->c_get(db_cursor, &key, &data, DB_MULTIPLE_KEY | DB_NEXT);
cursor read lock disappears. You can check that with db_stat tool.
When I call ret = db_cursor->c_get(db_cursor, &key, &data, DB_MULTIPLE_KEY | DB_SET_RANGE); I take a lock on page 1.
2 READ_UNCOMMITTED 1 HELD ./databese.db page 1
But after call ret = db_cursor->c_get(db_cursor, &key, &data, DB_MULTIPLE_KEY | DB_NEXT); the lock disappears.
On next iterations I read data without lock on pages. I suppose it is an error. I also attached a patch, which fix a problem. Please check it.
Hope the problem will be fixed.
Thanks in advance.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.