Commit c54cedb
authored
## Description
- Adds a `marc_export_reset` Celery task that sets up the next MARC
export as a first run by removing existing files (database records and
S3 objects). The records are deleted in one transaction, and S3 deletion
is best-effort, so a failure won't leave the reset half-applied.
- Queues the reset when a library's MARC exporter settings change in the
admin interface and when a library registry pushes a new web client URL
(only if the change would result in a new web client URL).
- First-run full exports now also record a full-content delta pointing
at the same S3 object, so (1) consumers that only apply delta files
receive the complete refreshed dataset without a second upload and (2)
we avoid an extra upload and the doubled storage utilization.
- Export finalization now detects a configuration change that raced an
in-flight export (records reset, settings drift, or the library no
longer MARC-enabled), discards the stale upload, and immediately
re-queues a fresh full export.
- Cleanup and reset only delete a shared S3 object when the last record
referencing it is removed, and upload aborts are best-effort so cleanup
failures cannot cascade.
- The MARC download page labels the full-content delta as "Full content
as of <date>" instead of a date range starting at the full delta
sentinel epoch.
## Motivation and Context
MARC record exports run periodically, but a configuration change would
not trigger an update. Record updates based on those changes might not
become available until long after the change was made. Further, some
MARC consumers apply only delta files rather than reprocessing full
exports. When a library's MARC export configuration changed
(organization code, summary/genre inclusion, web client URLs), records
exported before the change were never corrected for those consumers,
leaving stale data in their catalogs indefinitely. Resetting the
library's export state on configuration changes forces a full refresh
that reaches both full-file and delta-only consumers.
[Jira PP-4637]
## How Has This Been Tested?
- New and updated tests for the new functionality.
- All tests/checks pass locally.
- [CI
tests](https://github.com/ThePalaceProject/circulation/actions/runs/29181152088)/checks
pass.
## Checklist
- [x] I have updated the documentation accordingly.
- [x] All new and existing tests passed.
1 parent 3a39802 commit c54cedb
13 files changed
Lines changed: 1170 additions & 40 deletions
File tree
- src/palace/manager
- api
- admin/controller
- controller
- celery/tasks
- integration
- catalog/marc
- discovery
- tests
- fixtures
- manager
- api
- admin/controller
- controller
- celery/tasks
- integration
- catalog/marc
- discovery
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
| 16 | + | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
| |||
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
90 | 103 | | |
91 | 104 | | |
92 | 105 | | |
93 | 106 | | |
94 | 107 | | |
95 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
96 | 121 | | |
97 | 122 | | |
98 | 123 | | |
99 | 124 | | |
100 | 125 | | |
101 | 126 | | |
102 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
103 | 139 | | |
104 | 140 | | |
105 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
| |||
0 commit comments