From f465579caf94e495253ecf5ba95888dba4a4e95c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Sun, 1 Mar 2026 22:12:32 +0100 Subject: [PATCH] wip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- .../blog/news/read-after-write-consistency.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 docs/content/en/blog/news/read-after-write-consistency.md diff --git a/docs/content/en/blog/news/read-after-write-consistency.md b/docs/content/en/blog/news/read-after-write-consistency.md new file mode 100644 index 0000000000..150ac323f1 --- /dev/null +++ b/docs/content/en/blog/news/read-after-write-consistency.md @@ -0,0 +1,46 @@ +--- +title: Welcome read-cache-after-write consistency!!! +# todo issue with this? +#date: 2026-03-25 +author: >- + [Attila Mészáros](https://github.com/csviri) +--- + +**TL;DR:** +In version 5.3.0 we introduced strong consistency guarantees for updates. +You can now update resources (both your custom resoure and managed resource) +and the framwork will guaratee that these updates will be instantly visible, +thus when accessing resources from caches; +and naturally also for subsequent reconciliations. + +```java + +public UpdateControl reconcile(WebPage webPage, Context context) { + + ConfigMap managedConfigMap = prepareConfigMap(webPage); + // apply the resource with new API + context.resourceOperations().serverSideApply(managedConfigMap); + + // fresh resource instantly available from our update in the caches + var upToDateResource = context.getSecondaryResource(ConfigMap.class); + + // from now on built in update methods by default use this feature; + // it is guaranteed that resource changes will be visible for next reconciliation + return UpdateControl.patchStatus(alterStatusObject(webPage)); +} +``` + +In addition to that framework will automatically filter events for your updates, thus those +which are result of our own updates. + +{{% alert color=success %}} +**These should significantly simplify controller development, and will make reconciliation +much simpler to reason about!** +{{% /alert %}} + +This post will deep dive in this topic, and explain all the rational and background behind this topic. + +## Informers and eventual consistency + + +