[Xapian-tickets] [Xapian] #675: Exception in [Chert/Glass]Cursor::find_entry()
Xapian
nobody at xapian.org
Tue Apr 28 06:08:11 BST 2015
#675: Exception in [Chert/Glass]Cursor::find_entry()
---------------------------+-----------------------------
Reporter: Kronuz | Owner: olly
Type: defect | Status: assigned
Priority: high | Milestone: 1.2.21
Component: Backend-Chert | Version:
Severity: normal | Resolution:
Keywords: | Blocked By:
Blocking: | Operating System: All
---------------------------+-----------------------------
Changes (by olly):
* milestone: 1.3.3 => 1.2.21
Comment:
Before we actually use the data in the cursor, we check `B->cursor_version
!= version` and if it isn't, we call `rebuild()` which updates the cursor
to match the table.
The table's `cursor_version` gets incremented each time `add()` or `del()`
is called if at least one cursor has been created since the last call (the
reason for this condition is to avoid churning the counter unnecessarily
and having it wrap round).
Looking over the code involved, I see two bugs here though - we don't set
`cursor_created_since_last_modification` in the cursor `rebuild()` method,
but that flag is meant to really indicate if any cursor might exist with
the current `cursor_version`, and after `rebuild()` a cursor now does.
Also, we don't consider incrementing `cursor_version` after `cancel()` or
`reopen()` (the latter being very relevant here).
Fixing those, your testcase passes cleanly. I've written a testcase based
on it and committed the fixes + the testcase in
[1900eca6d325e9185b9f9f5c75a4a4a545616d7f/git]. Testing I found that the
fixes for `reopen()` and `rebuild()` are both required to fix the
testcase.
I think we're now good after those changes - although with chert the
cursor still has a reference to a freed root block, the cursor will now
get rebuilt before being used, so that doesn't actually matter as that dud
reference will never get used.
If this doesn't fix the problem in you full system, please comment with
details.
Marking for backporting for 1.2.21.
--
Ticket URL: <http://trac.xapian.org/ticket/675#comment:9>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list