Skip to content

Refuse the deprecated partition flag alongside a per-partition limit - #652

Merged
devhawk merged 2 commits into
mainfrom
refuse-partition-flag-with-limits
Oct 29, 2026
Merged

devhawk merged 2 commits into
mainfrom
refuse-partition-flag-with-limits

Conversation

@devhawk

@devhawk devhawk commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Registering or updating a queue with the deprecated partition flag (QueueOptions.partitionQueue / Queue.partitioningEnabled) set to true together with a per-partition limit (partitionConcurrency, partitionWorkerConcurrency or partitionRateLimit) now throws IllegalArgumentException: "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.

  • 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 is never refused. It carries both, because the stored partition_queue column is derived from the limits, but it is never validated as read, and updateQueue carries isLegacyPartitioned() rather than the stored flag.
  • partitionQueue(false) together with a per-partition limit is still accepted.
  • The flag on its own keeps its legacy meaning.

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

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.
@devhawk
devhawk requested review from kraftp, maxdml and qianl15 and a balanced review from Copilot October 29, 2026 19:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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

@devhawk
devhawk merged commit a632181 into main Oct 29, 2026
12 checks passed
@devhawk
devhawk deleted the refuse-partition-flag-with-limits branch October 29, 2026 20:18
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.

3 participants