orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Azure queue stream provider can stop reading from one or more queues

Open jafletch opened this issue 9 years ago • 18 comments

I've seen this issue now 3 times on production systems over the last month or two. I have some anecdotal ideas on what is going on though I have no simple repro for this. My current setup is using: Orleans 1.5.0 (I have also seen this repro with 1.4.2 at least) 2 silos reading from a stream backed by 10 queues Auto-scale up/down enabled The behavior I see is that one or more of the 10 queues will just start to accumulate messages without dequeuing. This will continue until the silo currently hosting the pulling agent assigned to those queues is rebooted. The most recent occurrence of this issue coincided with two auto-scale down operations where the current owners of the pulling agents were taken offline and the queues should have been transferred to new silos. In this case, one silo went offline resulting in one queue stopping read and then 15 mins later a second silo went offline resulting in a second queue stopping read.

Log file attached should include the times when both queues stopped reading though nothing obvious stands out to me.

Queue workflowprocessprovider-4 stopped dequeuing at 02:43:42 UTC and workflowprocessprovider-2 stopped at 02:57:58 UTC

4b6732d4-79cb-4dcb-bf78-dbe62196ed9b.zip

jafletch avatar Aug 14 '17 19:08 jafletch

The previous log file attached contains data from 2 deployments when it should only contain data from one. Please ignore the previous log file and use this one. SingleDeployment_AzureQueueIssue_3300.zip

jafletch avatar Aug 14 '17 19:08 jafletch

which queue balancer is your stream provider configured with?

xiazen avatar Aug 14 '17 19:08 xiazen

I haven't done anything specific to change the queue balancer so it would be whatever is the default, I assume.

jafletch avatar Aug 14 '17 19:08 jafletch

This will continue until the silo currently hosting the pulling agent assigned to those queues is rebooted.

I asked that question because this kind of behavior can be caused by choosing StaticClusterConfigDeploymentBalancer or StaticAzureDeploymentBalancer for your streamprovider. But looks like that is not the case since the default is ConsistentQueueBalancer, which should be rebalancing queues to alive silos in a auto-scale scenario.

The log you parsed to us, is it logs from one silo/the going-to-be-dead silo, or is it logs from all silos in that cluster? I ask this because it is hard for me to determine whether queues are transferred to other silos by just looking at logs from one silo.

In this case, one silo went offline resulting in one queue stopping read and then 15 mins later a second silo went offline resulting in a second queue stopping read.

This confused me a little bit. Based on the logs, one silo took multiple queues. If that silo went offline and only one queue stopped reading, does this mean his other queues got transferred to other silos? Or do you mean all of his queues stopped reading?

xiazen avatar Aug 14 '17 20:08 xiazen

The log attached (make sure you are looking at the second one, not the first) includes all content from all silos including the ones that go offline (ModelEngine.Silo.GraphBuilder_IN_2, 3, 4 & 5 in the RoleInstance column).

The only queues to stop reading events were numbers workflowprocessprovider-2 & 4. All others were working as expected.

jafletch avatar Aug 14 '17 20:08 jafletch

2017-08-14T02:57:44.6202707Z 2017-08-14T02:57:44.6202707Z DEV ModelEngine.Silo.GraphBuilder ModelEngine.Silo.GraphBuilder_IN_1 4 3888a013-2109-5e06-aa11-46e227592931 Orleans-Trace 2 1988 3564   OrleansTrace   00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000000 Logger="Provider" Caller="PersistentStreamPullingManager-WorkflowProcessesProvider" Message="I am responsible for a total of 4 queues on stream provider WorkflowProcessesProvider: [workflowprocessesprovider-1, workflowprocessesprovider-7, workflowprocessesprovider-4, workflowprocessesprovider-2]." IP="10.0.0.7:11111" Exception="" EventCode="103523" cbcf7ebd-7c83-11e7-a69f-0003ffb6d99d___360777558259 WinESProcessModelingOrleansSiloVer4v0 winesteluscprod3

Based on the above logs, at 02:57:44, workflowprocessprovider-2 & 4 has been assigned to odelEngine.Silo.GraphBuilder_IN_1. So looks like some silo did pick these two queue up. So forgive me asking another dumb question, what makes you think those two queues stopped pulling messages. Is it based on SiloLogStatistics? Or you look at your AzureQueueConsole and see messages are not being pulled?

xiazen avatar Aug 14 '17 21:08 xiazen

And another question, how many Orleans streams are in your cluster?

xiazen avatar Aug 14 '17 21:08 xiazen

I know that the messages are not being pulled by checking the queues directly via Azure Cloud Explorer.

The cluster uses 3 streams, 2 are Azure queue based 1 is Event Hub based.

jafletch avatar Aug 14 '17 21:08 jafletch

We noticed in the logs, there's only Info level logs. We haven't found any Warnings or Error, which can help us investigate. Is the log giving to us the full log, or is it filtered to just Info?

xiazen avatar Aug 15 '17 18:08 xiazen

For the production systems, I generally keep the level set to Info. I can increase it for pre-prod environments but I have no way of knowing if/when this will repro again.

jafletch avatar Aug 15 '17 18:08 jafletch

log level 'info' should include warnings and errors. So if the service is set to 'info' and we're not seeing errors or warning something seems amiss. Are either of the below possible?

  • The query run to get the log events sent to us was filtering for 'info' (level == 4) rather than for everything up to info level (level <= 4).
  • A custom log consumer is being used which is not logging errors or warnings.

jason-bragg avatar Aug 15 '17 19:08 jason-bragg

Adding another log as it appears I may have stripped out a few warnings 40818ee6-c6bf-4a46-954b-68369ebca14f.zip

jafletch avatar Aug 15 '17 22:08 jafletch

We think we found a bug in AzureQueueStreamProvider which can potentially cause this. Thanks for reporting this.

xiazen avatar Aug 16 '17 00:08 xiazen

Does the fix fit 1.5.1?

sergeybykov avatar Aug 16 '17 15:08 sergeybykov

yes it suits 1.5.1

xiazen avatar Aug 16 '17 17:08 xiazen

submitted a fix in #3311

xiazen avatar Aug 16 '17 21:08 xiazen

the fix is scheduled for 1.5.1. Highly recommend to adopt it soon

xiazen avatar Aug 17 '17 18:08 xiazen

Resolved via #3311.

sergeybykov avatar Sep 22 '17 18:09 sergeybykov