Repository navigation
Conversation
…ttic Node_Updater and Way_Updater initialise partial_possible to false when keeping attic data, but the constructor body then overwrites it with "the database files don't exist yet". So a fresh `update_database --keep-attic` import runs in partial mode, and partial mode clears new_skeletons, attic_skeletons and new_attic_skeletons after each node or way update. The way updater needs the new attic node skeletons to compute the geometry and index of older way versions, and the relation updater needs the new attic way skeletons likewise. Without them, a way version that is older than the latest move of one of its nodes gets an empty geometry and the invalid index, so [date:] queries by bounding box don't find it. Keep the initialiser's intent: partial updates only without attic data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01736kJV9ygtU1g57EBR2Ufo
This was referenced Nov 21, 2026
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.
Fixes #34.
Collected with the other import changes on
better-imports, which is kept apart fromall-changes.Change
Node_UpdaterandWay_Updaterinitialisepartial_possibleto false when keeping attic data, and the constructor body then overwrites it with "the database files don't exist yet". So a freshupdate_database --keep-atticimport runs in partial mode. After each node or way update, partial mode clearsnew_skeletons,attic_skeletonsandnew_attic_skeletons.The way updater needs the new attic node skeletons to compute the geometry and index of older way versions, and the relation updater needs the new attic way skeletons likewise. With them cleared, a way version that is older than the latest move of one of its nodes gets an empty geometry and the placeholder index, so
[date:]queries by bounding box don't find it.The change keeps the initialiser's intent: partial updates only without attic data. Two constructors, two lines each.
Impact
Benchmark queries and the prompting query: none. Only
update_database,update_from_dirandmigrate_databaselink the changed files;osm3s_queryis built from the same code as onupstream/master. Not re-timed.Import: a Geofabrik full-history extract of Prince Edward Island (licensed, not shareable; 3.1 M node, 291 k way and 28 k relation versions), imported with
osmium cat x.osh.pbf -f osh -o - | update_database --db-dir=db/ --keep-atticon a 4-core, 15 GB cloud container (page cache not dropped between runs):upstream/masterSingle runs each; the run for this PR overlapped with other jobs on the machine, so its time is indicative only. The extra memory is the attic skeletons that are no longer cleared; they are bounded by one batch, as in diff updates.
Testing
For each date, all objects in the world box at that date, compared with
osmium time-filter <file> <date>:upstream/masterMissing relations at 2018 drop from 188 to 68; all 68 have no node or way member present at that date in the extract, so Overpass can't locate them by design (it locates relations by node and way members only).
Not fixed here, because they need the other history-import changes: deleted versions (#45), ways using deleted nodes (#46), imports in several batches (#47), flushes inside an element's versions (#48).
Limitations
--keep-atticimports now update the database in place after each flush instead of writing partial files and merging them. For PEI that cost about 10% more time in one run; not measured on a large file.Generated by Claude Code