Get instance id for desired control-queue(s)#1069
Conversation
…ettings.cs Co-authored-by: David Justo <david.justo.1996@gmail.com>
| controlQueueNumberToNameMap = new Dictionary<string, int>(); | ||
|
|
||
| for (int i = 0; i < partitionCount; i++) | ||
| { | ||
| var controlQueueName = AzureStorageOrchestrationService.GetControlQueueName(settings.TaskHubName, i); | ||
| controlQueueNumberToNameMap[controlQueueName] = i; | ||
| } | ||
| } |
There was a problem hiding this comment.
are we still using this in the new tests? No, right?
davidmrdavid
left a comment
There was a problem hiding this comment.
Have we tested this for external events as well?
…https://github.com/pasaini-microsoft/durabletask into users/pasaini/main/InstanceIdForSelectedControlQueue
| /// <summary> | ||
| /// Whether to allow instanceIDs to use special syntax to land on a specific partition. | ||
| /// If enabled, when an instanceID ends with suffix '!nnn', where 'nnn' is an unsigned number, the instance will land on the partition/queue for to that number. | ||
| /// </summary> | ||
| public bool EnableExplicitPartitionPlacement { get; set; } = false; |
There was a problem hiding this comment.
Something to consider - it is not safe to change this from false to true (or vice-versa) while an orchestrator with the special syntax is in-flight. If we do that, any pre-existing messages for that orchestrator may now be considered to be "in the wrong queue".
Let's call this out in the intellisense
|
|
||
| int placementSeparatorPosition = instanceId.LastIndexOf('!'); | ||
|
|
||
| // if the instance id ends with !nnn, where nnn is an unsigned number, it indicates explicit partition placement |
There was a problem hiding this comment.
can we add a test that documents the behavior if the customer uses an instanceID with multiple ! in there? Say instanceID "A!1!B!3` should probably map to partition "3", right?
There was a problem hiding this comment.
Let's also add a test that checks that instanceID myinstanceID!NotANumber does not trigger any errors / that it correctly ignores the explicit placement logic.
There was a problem hiding this comment.
Thank you for adding the first test, I think we're just missing the very last one:
Let's also add a test that checks that instanceID myinstanceID!NotANumber does not trigger any errors / that it correctly ignores the explicit placement logic.
Motivation
#1079
Issue: No way of targeting an orchestrator instance to a desired control-queue.
Motivation:
Issue: No way to load lightly loaded control-queues.
Motivation:
Proposal
API to generate instance id for a set of control-queues.