wrolpi/controller
lrnselfreliance 6772762ce9
A secondary deletes its own stale write-ahead logs, and the sync leaves no stray files (#994)
* A secondary deletes its own stale write-ahead logs, and the sync leaves no stray files

Found by the first sync between two real machines:

- The primary's unfinished files (SQLite logs, partial downloads) were excluded from the copy, and an excluded path
  is never deleted on the receiving side.  So a secondary kept its own write-ahead log beside a map search
  database the primary had replaced, and SQLite would apply that log to the new database.  These patterns are now
  only hidden on the primary's side, so the secondary's stale ones are deleted (to the trash).
- Reading the incoming snapshot to check it made a -wal and -shm beside it, which stayed behind when the snapshot
  was moved into place.  It is now opened immutable.
- The primary's info, written by the Controller (root), belonged to root.  Files the Controller writes in the media
  directory now belong to its owner, like the directories it makes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* With deletes turned off, a secondary still drops its stale unfinished files

Review found that the hide rules of the previous commit only take effect through --delete, which is not given when
delete_after_days is null (never delete).  A secondary then kept its own write-ahead log beside a database the
primary had replaced, and SQLite applied it to the new database.

Without a trash, --delete is now given with every path protected except the unfinished patterns (and what is
inside an unfinished folder), so only those are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 14:19:09 -07:00
..
api The Controller can make a secondary a copy of its primary with rsync (#992) 2026-11-18 20:21:55 -07:00
lib A secondary deletes its own stale write-ahead logs, and the sync leaves no stray files (#994) 2026-11-19 14:19:09 -07:00
templates A failed upgrade is shown on the upgrade page instead of redirecting home (#955) 2026-11-08 11:11:59 -07:00
test A secondary deletes its own stale write-ahead logs, and the sync leaves no stray files (#994) 2026-11-19 14:19:09 -07:00
__init__.py Creating Controller service which will control WROLPi services, admin, SMART, disks, and status. nginx will fallback to Controller UI when React UI is unavailable (such as during upgrades). 2025-12-15 15:48:40 -07:00
conftest.py The hotspot starts on boot (#829) 2026-10-13 19:29:15 -06:00
defaults.py A WROLPi serves its library over rsync, and makes a database snapshot on request (#988) 2026-11-18 16:47:02 -07:00
main.py The Controller can make a secondary a copy of its primary with rsync (#992) 2026-11-18 20:21:55 -07:00
requirements.lock Python packages install from hash-locked requirements; yt-dlp still floats (#913) 2026-11-01 12:00:39 -07:00
requirements.txt build(deps): update pytest-asyncio requirement in /controller (#926) 2026-11-02 12:05:36 -07:00
rsyncd.conf A WROLPi serves its library over rsync, and makes a database snapshot on request (#988) 2026-11-18 16:47:02 -07:00
serve.py Migrating Controller from port 8087 to 80 so that it is more discoverable. Reformatting Controller dashboard to make header at the top. Reformatting navigation bar to handle the new links which prevented Admin from being visible in some screens. 2026-04-09 15:01:05 -06:00