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

CosmosDB: Session token optimization and ChangeFeedProcessor bug fixes #25492

Closed
wants to merge 9 commits into from

Conversation

milismsft
Copy link
Contributor

@milismsft milismsft commented Nov 18, 2021

By default we don't scope the global session token in Gateway when partition key ID is part of the request. For containers with a very large number of partitions and multi-region account setting, this can result in "Request headers too long" errors.
The change is to look first at the current request's headers and if the request is scoped to one specific partition, we should also scope the session token to that specific partition. This change is primarily targeting the ChangeFeedProcessor implementation where it's confirmed that we set the partition key ID information as part of the header prior to adding the session token. A more general fix addressing any other cases is not within the scope of these changes.

ChangeFeedProcessor related changes: when the renewer task is cancelled, we also need to close the processor task even if we are about to check-point the current state. The change also ensures that any exceptions are prioritized accordingly.

Added more logs to CFP to allow for better monitoring of the current processing.

Added test case for the scoped session token and simplified the existing CFP test.

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

By default we don't scope the global session token in Gateway when partition key ID is part of the request. For containers with a very large number of partitions and multi-region account setting, this can result in "Request headers too long" errors.
The change is to look first at the current request's headers and if the request is scoped to one specific partition, we should also scope the session token to that specific partition.

ChangeFeedProcessor related changes: when the renewer task is cancelled, we also need to close the processor task even if we are about to check-point the current state. The cange also ensures that any exceptions are prioritized accordinally.

Added more logs to CFP to allow for better monitoring of the current processing.

Added test case for the scoped session token and simplified the existing CFP test.
@milismsft milismsft added Cosmos cosmos:v4-item Indicates this feature will be shipped as part of V4 release train labels Nov 18, 2021
@milismsft milismsft self-assigned this Nov 18, 2021
@milismsft milismsft requested a review from xinlian12 as a code owner November 18, 2021 04:40
@milismsft
Copy link
Contributor Author

/azp run java - cosmos - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@simplynaveen20 simplynaveen20 left a comment

Choose a reason for hiding this comment

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

As per our discussion we have issue where gateway mode sending session token for every create request, please cover that issue

When the renewer task is cancelled, we also need to close the processor task even if we are about to check-point the current state. The change also ensures that any exceptions are prioritized accordingly.

Added more logs to CFP to allow for better monitoring of the current processing.

Update CFP test in order to simplify the logic.
@milismsft
Copy link
Contributor Author

changes were merged as part of different PRs

@milismsft milismsft closed this Dec 22, 2021
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-java that referenced this pull request Sep 28, 2023
[Hub Generated] Review request for Microsoft.ContainerService/aks to add version preview/2023-08-02-preview (Azure#25891)

* Adds base for updating Microsoft.ContainerService/aks from version preview/2023-07-02-preview to version 2023-08-02-preview

* Updates readme

* Updates API version in new specs and examples

* update (Azure#25469)

* Fix the IstioComponents structure (Azure#25492)

* add netorkPolicy "none" (Azure#25511)

* add netorkPolicy "none" value and description

* add "none" enum value to networkPolicy

* add addon autoscaling api (Azure#25479)

* Update trusted access put and delete to async operation (Azure#25537)

* Update trusted access put and delete to async operation

* Update example

* Update header

* Swagger changes for adding autoscalerprofile flags for daemonset/multipleexpander (Azure#25487)

* Adding json changes

* adding "daemonsets" to the custom-words

* Editing "Expander" to "expander"

* Removing daemonset custom word from this pr. look at: Azure/azure-rest-api-specs#25533

* Add AzureServiceMesh example (Azure#25560)

* Add AzureServiceMesh example

* Fix AKV resource id format

* enrich ASM examples (Azure#25598)

---------

Co-authored-by: deveshdama <[email protected]>
Co-authored-by: robogatikov <[email protected]>
Co-authored-by: Chih-Sheng Huang <[email protected]>
Co-authored-by: Tongyao Si <[email protected]>
Co-authored-by: Youn Jae Kim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cosmos:v4-item Indicates this feature will be shipped as part of V4 release train Cosmos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants