leaves12138 commented on code in PR #8871:
URL: https://github.com/apache/paimon/pull/8871#discussion_r3659121564
##########
paimon-common/src/main/java/org/apache/paimon/lookup/sort/db/LocalKvDb.java:
##########
@@ -643,6 +734,228 @@ private void ensureOpen() {
}
}
+ private void ensureNoRangeIterator() {
Review Comment:
`bulkLoad` also mutates `levels`, but it does not call
`ensureNoRangeIterator()`. `rangeIterator()` keeps the `LsmLevels` read lock
until close, while `bulkLoad()` eventually calls `levels.addFiles()` and needs
the write lock. With an iterator open on an empty DB, a concurrent bulk load
blocks until close; invoking it on the iterator-owning thread deadlocks
permanently because this lock cannot be upgraded. Please guard `bulkLoad` as
well and add a regression test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]