Skip to content

RDoc-3911 Enforce Revisions Configuration & MaxOpsPerSecond throttling#2530

Merged
ppekrol merged 5 commits into
ravendb:mainfrom
Danielle9897:RDoc-3911-maxOpsPerSecForEnforceRevisions
Jun 23, 2026
Merged

RDoc-3911 Enforce Revisions Configuration & MaxOpsPerSecond throttling#2530
ppekrol merged 5 commits into
ravendb:mainfrom
Danielle9897:RDoc-3911-maxOpsPerSecForEnforceRevisions

Conversation

@Danielle9897

@Danielle9897 Danielle9897 commented Jun 21, 2026

Copy link
Copy Markdown
Member

Issue link

https://issues.hibernatingrhinos.com/issue/RDoc-3911/Enforce-Revisions-Configuration-Document-MaxOpsPerSecond-throttling

Additional description

  • Studio:
    Updated section: Enforce Configuration

  • Client API:
    Created article: ../document-extensions/revisions/client-api/operations/enforce-revisions-configuration.mdx
    (C#, Java, Node.js)
    Python doesn't support this yet


    @haludi pls review
    docs/document-extensions/revisions/client-api/operations/content/_enforce-revisions-configuration-csharp.mdx
    @M4xymm pls review
    docs/document-extensions/revisions/client-api/operations/content/_enforce-revisions-configuration-nodejs.mdx
    @LielNagar pls review
    docs/document-extensions/revisions/client-api/operations/content/_enforce-revisions-configuration-java.mdx


Type of change

  • Content - docs
  • Content - cloud
  • 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)

@LielNagar

Copy link
Copy Markdown

Java file looks perfect! :)

Operation operation = await store.Operations.SendAsync(enforceConfigurationOp);

// Wait for the operation to complete and get its result
var result = (EnforceConfigurationResult)await operation.WaitForCompletionAsync(TimeSpan.FromSeconds(30));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Minor but I think it is cleaner to use the generic version:
var result = await operation.WaitForCompletionAsync<EnforceConfigurationResult>(TimeSpan.FromSeconds(30));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

| **IncludeForceCreated** | `bool` | `true` - [Force-created revisions](../../../../../document-extensions/revisions/overview.mdx#force-revision-creation) may also be removed by the operation.<br/>`false` (default) - Force-created revisions are not included in deletion paths that protect them. |
| **MaxOpsPerSecond** | `int?` | Limits the number of documents processed per second.<br/>`null` (default) - no throttling.<br/>Must be greater than `0`, otherwise an `InvalidOperationException` is thrown. |
| **Collections** | `string[]` | The collections the operation applies to.<br/>`null` or empty array - the operation applies to all collections. |
| **ContinuationParameters** | `RevisionsOperationContinuationParameters` | Optional state used to resume a previous revisions operation.<br/>Populate it from the previous result's `LastProcessedEtags`, `EtagBarriersUsed`, and `NodeTags`. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@karmeli87

  • If the previous operation ended without issue, why do I need to resume it?
  • If the previous operation failed, how can I get the last ETag for it?
    The result is not useful in either case.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

IIRC you get that in the progress result

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

  1. Modified the text below to:
    =>
`ContinuationParameters` is only needed when resuming an **interrupted** run (e.g. server restart, timeout, or a cancelled long-running operation).
A run that completed successfully does not need to be resumed.    

Because an interrupted run does not return a final result,  
capture the continuation values from the operation's **progress** while it runs:   
  * Subscribe to `Operation.OnProgressChanged` and keep the latest `EnforceConfigurationResult` value.  
  * `EnforceConfigurationResult` is reported as progress and carries `LastProcessedEtags`, `EtagBarriersUsed`, and `NodeTags`.    

Because etags are node-local, a resumed operation must run on the same node that produced them.  
Keep the `NodeTags` values from the progress result;  
they identify the node that produced the continuation values, and the server validates them on resume.
  1. Created a dedicated issue to describe this in general:
    https://issues.hibernatingrhinos.com/issue/RDoc-3948/Track-operation-progress

@Danielle9897 Danielle9897 Jun 23, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@haludi
I have added a new section: "Resume an interrupted operation"
See the latest commit.

@Danielle9897 Danielle9897 requested a review from haludi June 22, 2026 15:13
@ppekrol ppekrol merged commit 62e0465 into ravendb:main Jun 23, 2026
1 check passed
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.

6 participants