Skip to content

Fix and update the atomic guards page, add a Java version - #2745

Open
reebhub wants to merge 3 commits into
ravendb:mainfrom
reebhub:RDoc-4185_atomicGuardsPage
Open

reebhub wants to merge 3 commits into
ravendb:mainfrom
reebhub:RDoc-4185_atomicGuardsPage

Conversation

@reebhub

@reebhub reebhub commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Issue link

RDoc-4185 Fix the atomic guards page and update its layout
RDoc-4189 Add an atomic guards page Java version

Type of change

  • Content - docs
  • Content - cloud
  • Content - Quill
  • Content - guides
  • Content - start pages/other
  • New docs feature (consider updating /templates or readme)
  • Bug fix
  • Optimization
  • Other

Changes in docs URLs

  • No changes in docs URLs
  • Articles are restructured, URLs will change, mapping is required (update /scripts/redirects.json file, set Documents Moved PR label)

Changes in UX/UI

  • No changes in UX/UI
  • Changes in UX/UI (include screenshots and description)

…), retake its Studio screenshot (7.2)

Fix wrong claims, sample errors and broken anchors in the 6.2-7.0 atomic guards pages
@reebhub
reebhub requested a review from M4xymm November 24, 2026 08:42
@reebhub

reebhub commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

@LielNagar
Please review the atomic guards Java page (new, added just for 7.2) at docs/compare-exchange/content/_atomic-guards-java.mdx (I ran the samples against a 7.2 server with Java client 7.2.6)

@reebhub
reebhub requested a review from LielNagar November 24, 2026 08:49

@M4xymm M4xymm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one PHP behavior fix and a few small things inline.

Comment on lines +289 to +290
* **If an atomic guard exists**,
the client constructs a change vector for the document using the atomic guard’s Raft index, and the document will be saved with this change vector.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PHP client doesn't have this logic. It never looks up rvn-atomic/<id> when a load comes back empty, so it can't build a change vector from the guard. That part exists in the Node and C# clients only. As written, PHP users who load before storing will still fail to re-create a document that was deleted outside a cluster-wide session.

I'd drop the "If an atomic guard exists" bullet from the PHP page, or replace it with a note that the PHP client doesn't handle this case yet. The same goes for the "Best practice when storing a document" panel at L223-235: "load before store" doesn't help PHP here.

Same text in:

  • version-7.1/.../_atomic-guards-php.mdx L217-228 and L282-285
  • version-7.0 and version-6.2 .../_atomic-guards-php.mdx L207-218 and L272-275

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (also true for Python, so corrected for both languages, 6.2 - 7.2)

Comment on lines 256 to 263
* RavenDB checks whether the Raft index of the atomic guard associated with the document matches the version tracked by the current session.
If another session has already updated the document (and incremented the atomic guard’s Raft index), the save will fail with a `ClusterTransactionConcurrencyException`.

* **If no document is found**, RavenDB will check whether a matching atomic guard exists (as in the case when the document was deleted outside of a cluster-wide session):
* **If no document is found**:
RavenDB will check whether a matching atomic guard exists (as in the case when the document was deleted outside of a cluster-wide session).
* **If an atomic guard exists**,
the client constructs a change vector for the document using the atomic guard’s Raft index, and the document will be saved with this change vector.
* **If no atomic guard exists**,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nested bullets mix 2-space and 4-space indents. Both render fine, but 2 spaces would match docs/7.1. Same in 7.0 and in both PHP files.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (o:

</Panel>

## When are atomic guards removed
<Panel heading="Atomic guard removal">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi: the rename changes the anchor from #when-are-atomic-guards-removed to #atomic-guard-removal. Nothing in the repo links to the old anchor, but links from outside the docs will break. Fine if that's intended.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, in this case I think we can take the risk

@M4xymm

M4xymm commented Nov 26, 2026

Copy link
Copy Markdown
Member

btw @reebhub the link to issue is incomplete in PR description

@reebhub

reebhub commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@M4xymm thx, fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants