Map data: the downloaded GeoNames text tables are kept beside the lookup databases built from them #1127
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#1127
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What exists today
manage.py fetch_geonames(src/postulo/jobs/management/commands/fetch_geonames.py:91-94) writesgeonames-cities1000.txtandgeonames-countryinfo.txt, then buildsgeonames-cities1000.sqlitefrom the text. With postcodes on, it writesgeonames-postcodes.txt(line 161) and buildsgeonames-postcodes.sqlite(line 162). In the dev tree,src/postulo/jobs/data/geonames-cities1000.txtis 32,116,760 bytes and the lookup built from it 30,511,104 bytes.After the build, the cities text is read for three things only, none of which needs its content:
jobs/places.py:87-89_cities_file()returns it if present, andavailable()(line 364-366) answers "is the dataset here" with it;_index()(lines 148-176) rebuilds the lookup when the text's mtime is newer than the lookup's, which matters only when an operator drops a new text in by hand;docker/entrypoint.sh:32downloads the dataset on start when the text is missing.The country table (
geonames-countryinfo.txt, read atplaces.py:211) is small and is read for its content; it is not part of this finding. The scout's "only for mtime comparison" is corrected: the text is also the presence marker, which is why it cannot simply be deleted without changing those three places.What would change
fetch_geonamesdeletes the cities text (and the postal-code text) once the lookup it built has passed its own checks.available()and_index()accept the lookup alone: present lookup and no text means "use the lookup"; a text newer than the lookup (an operator's hand-placed table, asentrypoint.sh:28-29describes) still triggers a rebuild, after which the text may stay, since the operator put it there.entrypoint.sh:32tests for either file.The download is unchanged; a re-fetch still writes the text, builds, and removes it.
What it saves or protects
small: 32 MB of
geonames-cities1000.txton every instance's data volume (measured in the dev tree), plus the postal-code text where postcodes are switched on (not measured here)Accessibility
none
Decisions
fetch_geonamesitself downloaded.Found by the efficiency and reliability audit of 2026-10-30 (finding D7; index postulo/postulo#1108). Checked against
mainatdaee30b15(2026-10-30).