Skip to content

Hold document rows with a locking read on PostgreSQL - #3712

Merged
pournasserian merged 2 commits into
feature/storage-jobs-and-testsfrom
3575-locking-read-on-postgresql
Nov 26, 2026
Merged

pournasserian merged 2 commits into
feature/storage-jobs-and-testsfrom
3575-locking-read-on-postgresql

Conversation

@pournasserian

Copy link
Copy Markdown
Member

Closes #3575

A hold now goes through IDataProvider.HoldDocumentAsync. On PostgreSQL it is SELECT ... FOR NO KEY UPDATE by primary key, which takes the row lock the update took and writes no new row version, so a publish no longer leaves a dead row per locale for vacuum to clear.

SQLite and SQL Server, and any provider that does not override the member, keep the update that sets nothing new. The lock timeout (FCMS2411), the deadlock rerun and the answer for a row that is gone, trashed or at another version behave as before.

DocumentHoldTests checks that the row is not rewritten across a hold and which statements wait for it, and that a lock timeout and a deadlock are still recognised; the gates of the lock-order tests also recognise the locking read. The content tests of FluentCMS.Data.Tests ran on PostgreSQL, and the lock classes on SQLite and SQL Server 2025. Spec 4.5 says what a hold is on each provider.

@pournasserian pournasserian added type:chore Repository, tooling or housekeeping area:storage EF Core model, providers and migrations area:content Content service and query model labels Nov 26, 2026
@pournasserian
pournasserian enabled auto-merge (squash) November 26, 2026 18:12
@pournasserian
pournasserian merged commit 37e557c into feature/storage-jobs-and-tests Nov 26, 2026
7 of 8 checks passed
@pournasserian
pournasserian deleted the 3575-locking-read-on-postgresql branch November 26, 2026 19:16
pournasserian added a commit that referenced this pull request Nov 26, 2026
…, and run every end-to-end case on WebKit (#3723)

Closes #3604
Closes #3606
Closes #3575
Closes #3574
Closes #3560
Closes #3553
Closes #3552
Closes #3562
Closes #3649
Closes #3648
Closes #3213
Closes #3709

Brings the batch of `feature/storage-jobs-and-tests` into `main`: eight
issues of storage, jobs and operations, the three end-to-end issues that
were left, and the removal of member sign-in with Apple.

Storage, jobs and operations:

- #3719 Add a key-value store with compare-and-set for plugins
(`IPluginStore<TPlugin>`, the table `cms_plugin_store`, ADR 0009)
- #3710 Copy a media file an import line names by key under a key of its
own
- #3712 Hold document rows with a locking read on PostgreSQL
- #3722 Pin the round trips of a publish, a scheduled publish and an
import
- #3714 Leave the drain job half of the release timeout to write its
outcome at a stop
- #3716 Correct the migrations lock guide and release what the lock
tests hold
- #3715 Count the client registration limit in
`fluentcms.rate_limit.refused`
- #3721 Tell a derived plugin name from a given one and pin long check
names and SQLite rebuilds

End-to-end tests of the admin:

- #3713 Run the two reload cases of the navigation progress on WebKit
- #3717 Run the close of a clean tab on WebKit
- #3718 Add the end-to-end case of an external login removed on the
account page
- #3720 Read the API keys secret holders on the renderer's dispatcher
(part of #3610; a test that failed twice on Windows)

Identity:

- #3711 Drop member sign-in with Apple (#3165 is closed as not planned)

Changes a host or a client can see:

- A host whose configuration names a member provider with `Type: Apple`
no longer starts (`FCMS3180`). The package `AspNet.Security.OAuth.Apple`
is no longer referenced.
- The table `cms_plugin_store` is folded into the system `Initial`, so a
database of an earlier build is refused with `FCMS1308` and must be
recreated; `plugin_store` becomes a reserved table name.
- An import line without a file now copies the file at the key it names
under a key of its own; `mediaNameKeys=true` (`--media-name-keys`) keeps
the earlier naming.
- At a stop the outbox drain's writes take half of `ReleaseTimeout`.
- `fluentcms.rate_limit.refused` gains the policy value
`client-registration`.

With #3713 and #3717 no end-to-end case is left out on WebKit. The
end-to-end project now references
`Microsoft.EntityFrameworkCore.Sqlite`, at the version already pinned,
to write a login into the test host's database.

The decisions the issues left open are recorded on #3604, #3606 (ADR
0009) and #3553. What the reviews left for later is on the follow-up
lists #3608, #3609, #3610 and #3611, with the lines the notes of the
next release owe. #3587 and #3581 were left out of the batch and stay
open.

Checked on the feature branch before this pull request: a quick run of
`CI` with the Firefox and WebKit end-to-end jobs, green on every job
(run 45890126997).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:content Content service and query model area:storage EF Core model, providers and migrations type:chore Repository, tooling or housekeeping

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant