Files
wekan/snap-src
Lauri Ojansivu 2ff21ac962 Snap: MongoDB files no reader can open are not compared with FerretDB.
An instance whose MongoDB data was written by a MongoDB older than any mongod
this snap carries printed, at every start and before the site came up:

  Database selection: setting='ferretdb' ferretdb_has_data=true mongodb_has_data=true
  WeKan: BOTH databases have been written to since the migration.
  [autopick] reading both databases to see which one holds the work ...

`mongodb_has_data` answers "are the files there", not "can anything here open
them", and on that instance those are different answers - the same issue shows
mongod 7, 5.0 and 4.2 each refusing the files in turn. So the comparison ran on
a copy that cannot be served, and it is not a cheap question: it starts a mongod
that cannot open the data, and then a second FerretDB against the SQLite
directory the running one already holds.

migration-control has already tried every reader in the snap and left
.mongodb-data-too-old behind when none of them could open the files. With that
marker present the MongoDB copy is not a candidate for holding the newest work,
so both comparison branches skip it and WeKan serves the FerretDB that has the
data. The empty-FerretDB safety still asks about the files being there, because
that one is not a comparison.

Nothing is deleted and the marker stays: it is true, and it is right again on a
snap that can read those files.

tests/snapUnreadableMongoNotCompared.test.cjs pins which question each branch
asks.

Thanks to mueschel and xet7 !

#6585 comment 5290402146
2026-08-14 13:50:19 +03:00
..