Repository navigation
Refuse the deprecated partition flag alongside a per-partition limit - #652
Merged
Merged
Conversation
Registering or updating a queue with partitionQueue (or
partitioningEnabled) set together with partitionConcurrency,
partitionWorkerConcurrency or partitionRateLimit now throws
IllegalArgumentException ("set only one of them"). Before, the flag was
accepted and ignored, since the limit already partitions the queue.
Python 2.31, TypeScript 4.27 and Go refuse the combination the same way.
The check is in Queue.validateForRegistration, so it covers
DBOS.registerQueue, DBOSClient.registerQueue, updateQueue and static
queues. A queue read back from the system database still carries both,
since its stored flag is derived from the limits, but it is never
validated as read. The flag on its own keeps its legacy meaning.
…ound it The code comment now says why the flag and a per-partition limit may not be set together: they disagree about the scope of the queue-wide limits. The QueueOptions javadoc again says an update refuses partitionQueue, true or false, on a queue partitioned by its limits. Tests now check that partitionQueue(false) may accompany a per-partition limit, and the client update refusal checks its message.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the partition-option validation change, which targets conflicting settings while retaining legacy flag-only behavior.
No open issues 🎉
What changed in this PR
This PR addresses the 1.x validation change in #610: queue registration and updates reject the deprecated partition flag when it is true alongside any per-partition limit, while preserving legacy flag-only behavior.
Changes:
- Add the conflict check to
Queue.validateForRegistration(). - Cover rejection through runtime and client APIs, unchanged state after rejected updates, and accepted flag-only or false-flag configurations.
- Update API documentation to explain the restriction.
| File | Description |
|---|---|
transact/src/test/java/dev/dbos/transact/queue/QueueLimitResolutionTest.java |
Test validation for all three per-partition limit types. |
transact/src/test/java/dev/dbos/transact/queue/PartitionedQueuesTest.java |
Test runtime registration and update rejection, plus accepted configurations. |
transact/src/test/java/dev/dbos/transact/client/ClientQueueTest.java |
Test client registration and update rejection. |
transact/src/main/java/dev/dbos/transact/workflow/QueueOptions.java |
Document incompatible partition options. |
transact/src/main/java/dev/dbos/transact/workflow/Queue.java |
Reject conflicting partition settings and document the rule. |
Review effort: Balanced
kraftp
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Registering or updating a queue with the deprecated partition flag (
QueueOptions.partitionQueue/Queue.partitioningEnabled) set totruetogether with a per-partition limit (partitionConcurrency,partitionWorkerConcurrencyorpartitionRateLimit) now throwsIllegalArgumentException: "partitionQueue is deprecated in favor of the partition limits; set only one of them". Before, the flag was accepted and ignored.Python 2.31, TypeScript 4.27 and Go refuse this combination the same way. Those are the releases that added the per-partition limits while keeping the flag. The two disagree about the scope of the queue-wide limits: with the flag alone, they apply per partition.
Queue.validateForRegistration, so it coversDBOS.registerQueue,DBOSClient.registerQueue,updateQueueand static queues.partition_queuecolumn is derived from the limits, but it is never validated as read, andupdateQueuecarriesisLegacyPartitioned()rather than the stored flag.partitionQueue(false)together with a per-partition limit is still accepted.Part of #610.
Release note: registering or updating a queue with both the deprecated partition flag and a per-partition limit now throws; drop the flag.
🤖 Generated with Claude Code