Import a new generation of the store rather than emptying the old one - #39
Merged
Merged
Conversation
RISCfuture
force-pushed
the
navdata/atomic-install
branch
from
September 8, 2026 07:17
78f584c to
e97dca3
Compare
RISCfuture
force-pushed
the
navdata/atomic-install
branch
2 times, most recently
from
September 8, 2026 08:02
0115b91 to
d097b04
Compare
RISCfuture
force-pushed
the
navdata/atomic-install
branch
from
September 8, 2026 15:48
d097b04 to
bc732a5
Compare
RISCfuture
force-pushed
the
navdata/atomic-install
branch
2 times, most recently
from
September 8, 2026 16:26
e156fb8 to
b04ce39
Compare
RISCfuture
force-pushed
the
navdata/atomic-install
branch
2 times, most recently
from
September 8, 2026 16:35
db60e58 to
7788f9d
Compare
RISCfuture
force-pushed
the
navdata/atomic-install
branch
from
September 8, 2026 18:09
7788f9d to
d9e3fd2
Compare
The import deleted the live dataset before writing its replacement, in many small committed transactions. Anything that stopped it in that window — a crash, or the system reclaiming the app — left an airport database that was permanently half there, which for an app that cannot work without one is not a state to recover from. It is why nav data was kept off every background path, and why the import had to ask the pilot to leave the app open. Each import now writes the next generation of the store to a file of its own and nothing reads it until it is whole. The switch is one recorded number, made only once the new store has been opened and found to hold airports; before that moment the dataset in use has not been touched at all. So an abandoned import costs a file nobody points at, reclaimed at the next launch, and resetData and its bounded delete loops are gone rather than made safe. Superseded generations are reclaimed only as a process opens its first container — however it opened one, including by discarding a bad one. Reclaiming later would mean deleting a file a container still alive may be reading, which is the very thing numbering generations avoids. A generation is written to a new file rather than over the old one because a store cannot be replaced underneath a reader: SQLite leaves the reader on a deleted inode, and the app is not the only process holding this store — the widget and the App Intents surfaces open it too. Numbers rise rather than alternate, so a generation an extension still has open is never reused beneath it. Cycles are no longer cleared before a download either. They were cleared first so a failed download would read as out-of-date, which a store the download never touches gives for free. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01471376Uhug2TYZN8RDFGtq
RISCfuture
force-pushed
the
navdata/atomic-install
branch
from
September 9, 2026 06:38
d9e3fd2 to
f60e56e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The import deleted the live dataset before writing its replacement, in
many small committed transactions. Anything that stopped it in that
window — a crash, or the system reclaiming the app — left an airport
database that was permanently half there, which for an app that cannot
work without one is not a state to recover from. It is why nav data was
kept off every background path, and why the import had to ask the pilot
to leave the app open.
Each import now writes the next generation of the store to a file of its
own and nothing reads it until it is whole. The switch is one recorded
number, made only once the new store has been opened and found to hold
airports; before that moment the dataset in use has not been touched at
all. So an abandoned import costs a file nobody points at, reclaimed at
the next launch, and resetData and its bounded delete loops are gone
rather than made safe.
A generation is written to a new file rather than over the old one
because a store cannot be replaced underneath a reader: SQLite leaves the
reader on a deleted inode, and the app is not the only process holding
this store — the widget and the App Intents surfaces open it too. Numbers
rise rather than alternate, so a generation an extension still has open
is never reused beneath it.
Cycles are no longer cleared before a download either. They were cleared
first so a failed download would read as out-of-date, which a store the
download never touches gives for free.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01471376Uhug2TYZN8RDFGtq
Stack created with GitHub Stacks CLI • Give Feedback 💬
🤖 Generated with Claude Code
https://claude.ai/code/session_01471376Uhug2TYZN8RDFGtq