Skip to content

A reader sees the objects file as it is now before giving up on a record - #1332

Merged
noha merged 1 commit into
mainfrom
a-reader-sees-the-file-grow
Oct 9, 2026
Merged

noha merged 1 commit into
mainfrom
a-reader-sees-the-file-grow

Conversation

@noha

@noha noha commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

A read-only reader of a database another process appends to can be sent by the index to a record its stream does not reach yet: over NFS the stream knows the objects file as long as the client last cached it. The metabase check of 674726be read 'receiver of < is nil' at a position 174 KB past the size its stream knew, and the record was there, intact; the check of 62398e23 has failed the same way since 2026-10-06.

SoilObjectFile reads a record that starts at or beyond the end it knows, or runs off it, once more after seeing the file as it is now. A read-only database opens the file anew for that; a writable one keeps its stream, since closing a file gives up the locks of the process on it.

A record that still cannot be read no longer ends the walk of the SoilTrackingVisitor: its trackers are told (#trackUnreadableRecord:in:), and the SoilDatabaseConsistencyTracker reports a SoilUnreadableRecordFinding with object id, version, position and file size.

@noha
noha force-pushed the a-reader-sees-the-file-grow branch 2 times, most recently from 55b02fa to 208adda Compare October 9, 2026 11:55
…cord

A read-only reader of a database another process appends to can be sent by
the index to a record its stream does not reach yet: over NFS the stream knows
the objects file as long as the client last cached it. The metabase check of
674726be read 'receiver of < is nil' at a position 174 KB past the size its
stream knew, and the record was there, intact; the check of 62398e23 has
failed the same way since 2026-10-06.

SoilVisitor>>recordAt:, where a read has failed already, opens the objects
file of the segment anew and reads the record once more before it gives it
up. Reads that succeed are not touched, and nothing outside the visitor
changes. Only a read-only database is opened anew; a writable one keeps its
stream, since closing a file gives up the locks of the process on it.

A record that still cannot be read no longer ends the walk of the
SoilTrackingVisitor: its trackers are told (#trackUnreadableRecord:in:), and
the SoilDatabaseConsistencyTracker reports a SoilUnreadableRecordFinding with
object id, version, position and file size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noha
noha force-pushed the a-reader-sees-the-file-grow branch from 208adda to d5c5f23 Compare October 9, 2026 11:56
@noha
noha requested a review from MarcusDenker October 9, 2026 11:57
@noha
noha merged commit f5296a0 into main Oct 9, 2026
5 checks passed

@MarcusDenker MarcusDenker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

noha added a commit that referenced this pull request Oct 9, 2026
The metabase check of 674726be, with #1332 in place, found 1:2168 at position
12324667346 although the objects file, opened anew, ended at 12324316892: the
writer's index had reached the NFS server before its records, as writeback
keeps no order between files. Opening the file again does not help there;
only time does.

So the rereading moves out of SoilVisitor, where #1332 put it for every reader
and every failed read, into SoilTrackingVisitor>>visitRecordAt:, which catches
the SoilUnreadableRecord anyway. It reads again only a record that is late
(#isLate:): of a read-only database, at or past the size of the objects file
the reader knows. It opens the file anew, reads at once, and then after the
pauses of #rereadDelays, half a minute in all. A record inside the file is
damaged and named at once. SoilVisitor>>recordAt: names an unreadable record
again, as before #1332.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noha
noha deleted the a-reader-sees-the-file-grow branch October 10, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants