fix: rebuilds collect under one lock and keep moved lastmods
A rebuild takes the transaction-scoped advisory lock golem15.sitemap.rebuild before it reads the settings and collects, and applies in the same transaction, so a second rebuild collects only after the first has committed. apply no longer writes the lastmod of a content row it did not create, so a lastmod RecordSaved moved meanwhile stays.
This commit is contained in:
@@ -108,7 +108,7 @@ A `pact.RecordDeleted` takes the record's addresses out of the files at once. Bo
|
||||
|
||||
### Rebuilds
|
||||
|
||||
`classes.Rebuild` walks `signpost.Registry.ContentTypes` in registration order, pages `Records` 500 at a time, keeps the published records' locales with an address, asks the Filter per page, adds the additional addresses and writes everything in one transaction that holds the settings row (two rebuilds never interleave). It returns the added, changed and removed absolute URLs.
|
||||
`classes.Rebuild` walks `signpost.Registry.ContentTypes` in registration order, pages `Records` 500 at a time, keeps the published records' locales with an address, asks the Filter per page, adds the additional addresses and writes everything. The whole rebuild runs in one transaction that first takes the advisory lock `golem15.sitemap.rebuild` and then reads the settings, collects and applies holding the settings row, so a second rebuild collects only after the first has committed and an older snapshot never overwrites a newer one. A rebuild never writes the lastmod of a content row it did not create (only an additional address takes its lastmod from the settings), so a lastmod a record save moved meanwhile stays. It returns the added, changed and removed absolute URLs.
|
||||
|
||||
Record events set `rebuild_pending_until` with a conditional update and enqueue one rebuild with that delay only when no pending time lies in the future; the job clears it when it starts. A settings save dispatches a rebuild at once (a `summer_jobs` row labelled "Rebuild the sitemaps").
|
||||
|
||||
@@ -241,7 +241,7 @@ The files table lists the image and News files too. A save refuses an invalid si
|
||||
| `contract.Filter`, `contract.Candidate`, `contract.Decision`, `contract.Group` | The filter other plugins implement. |
|
||||
| `contract.ReasonNoindex`, `contract.ReasonCanonical`, `contract.ReasonRedirect`, `contract.ReasonType` | The left-out reasons. |
|
||||
| `contract.Listing`, `contract.ListingSettings`, `contract.GroupInfo`, `contract.EntriesQuery`, `contract.Entry`, `contract.EntriesPage` | What the sitemap publishes for other plugins. |
|
||||
| `classes.Rebuild`, `classes.RebuildResult` | One rebuild of the slot table and what it changed. |
|
||||
| `classes.Rebuild`, `classes.RebuildResult`, `classes.WithAfterSlotRead` | One rebuild of the slot table and what it changed; the test seam called after the rebuild read the slot rows. |
|
||||
| `classes.RebuildArgs`, `classes.RebuildKind` | The rebuild job's arguments and kind `golem15.sitemap.rebuild`. |
|
||||
| `classes.RequestRebuild`, `classes.DispatchRebuild`, `classes.RequestDebouncedRebuild`, `classes.ClearPending`, `classes.Building` | Dispatching rebuilds and the debounce window. |
|
||||
| `classes.RecordSaved`, `classes.RecordDeleted`, `classes.RealChanges`, `classes.Changed` | The record event handling. |
|
||||
|
||||
Reference in New Issue
Block a user