Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot disable Analytical store in container (setting AnalyticalStoreTimeToLiveInSeconds to null has not effect) #4634

Closed
hesperanca opened this issue Aug 10, 2024 · 7 comments · Fixed by #4638

Comments

@hesperanca
Copy link

hesperanca commented Aug 10, 2024

According to the documentation, to disable the analytical store in a container we simply need to set the containerProperties.AnalyticalStoreTimeToLiveInSeconds to null.

According to our tests, setting the AnalyticalStoreTimeToLiveInSeconds to null in an existing container has not effect (the value doesn't get changed at all).

The code we are using to update the analytical store ttl value is:

 var dbContainer = _cosmosClient.GetContainer(<DatabaseName>, <ContainerName>);

 var containerResponse = await dbContainer.ReadContainerAsync();
 var containerProperties = containerResponse.Resource;

 // Only disable the analytical store if it's not already disabled
 if (containerProperties.AnalyticalStoreTimeToLiveInSeconds != null)
 {
     containerProperties.AnalyticalStoreTimeToLiveInSeconds = null;
     await dbContainer.ReplaceContainerAsync(containerProperties);
 }

Expected result:
The container property AnalyticalStoreTimeToLiveInSeconds should be set to null and the analytical store disabled in the container.

Actual result:
The value of AnalyticalStoreTimeToLiveInSeconds property remains the same and the analytical store remains enabled in the container.

@ealsur
Copy link
Member

ealsur commented Aug 12, 2024

Verified the SDK client behavior. When null is used, then the client correctly does not send the analyticalStorageTtl on the REST request. This behavior is the same as the DefaultTimeToLive (defaultTtl) which does work as expected.

Managed to repro the behavior on my side too. Will report back if I get more information.

@hesperanca
Copy link
Author

@ealsur. Thanks for confirming this. Can you think of a workaround in the meantime? We were about to release a new enhancement to our SAAS APP that relied on this (we are an MS ISV)?

Mant thanks.

@ealsur
Copy link
Member

ealsur commented Aug 12, 2024

The feature it seems cannot be disabled even from the Azure Portal, which leads me to believe this is related to system behavior (nothing seems wrong on the client SDK)

image

@hesperanca
Copy link
Author

I'm just trying to diable it on a specific Container. Not on all of them.

@ealsur
Copy link
Member

ealsur commented Aug 12, 2024

Correct, the above screenshot is the Portal UX for a specific container. The Analytical Storage Time to Live cannot be turned Off. Which maps what is happening on the client SDK (the SDK is sending the REST API payload without the configuration to disable it and the response comes back without disabling the TTL)

@hesperanca
Copy link
Author

Interestingly, in the portal, you cannot disable it on the Synapse Link section:

image

but you seem to be able to disable it on the Power BI section:

image

Confusing!!

@ealsur ealsur added the Service Bug The issue is created because of a Cosmos DB service bug. label Aug 12, 2024
@ealsur
Copy link
Member

ealsur commented Aug 12, 2024

https://learn.microsoft.com/en-us/azure/cosmos-db/analytical-store-introduction#analytical-ttl

It seems according to the documentation 0 or null should disabled it, but on my test, only 0 did. This would be a gap/misleading on the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants