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

ChangeFeedProcessorBuilder throws exception for ChangeFeedMode on 3.39.0 #4423

Closed
Blackbaud-IanThomas opened this issue Apr 16, 2024 · 2 comments · Fixed by #4426
Closed
Assignees
Labels
customer-reported Issue created by a customer needs-investigation

Comments

@Blackbaud-IanThomas
Copy link

We are continuously addressing and improving the SDK, if possible, make sure the problem persist in the latest SDK version.

Describe the bug
After upgrading to 3.39.0 of the SDK, services using ChangeFeedProcessorBuilder are throwing an exception with the description:

System.ArgumentException: Switching ChangeFeedMode to Incremental Feed is not allowed.

To Reproduce
The issue appears to be with services where the lease document is a "legacy document". To reproduce requires a service where the lease document does not have the "Mode" property. Using ChangeFeedProcessorBuilder with the following basic configuration:

_sourceContainer
                    .GetChangeFeedProcessorBuilder<JObject>("ChangeFeed", HandleChangesAsync)
                    .WithInstanceName($"ChangeFeed-{Guid.NewGuid()}")
                    .WithLeaseContainer(_leaseContainer)
                    .Build();

will result in the behavior.

Expected behavior
Services with legacy documents for change feed work after upgrade with no required changes.

Actual behavior
Services with legacy documents for change feed throw exception and fail to start change feed processor.

Environment summary
SDK Version: 3.39.0
OS Version (e.g. Windows, Linux, MacOSX)

Additional context

In exploring the underlying code, it appears that the default ChangeFeedProcessorBuilder is being set to ChangeFeedMode.LatestVersion here, but that is then getting mapped to a value for ChangeFeedIncremental, here.
When a legacy document is encountered, the mode is defaulted to LatestVersion here, which doesn't match anymore due to the remapping that took place in between.

@ernesto1596
Copy link
Contributor

This is a breaking change for our production service.

@philipthomas-MSFT
Copy link
Contributor

Investigation underway. Thanks for your patience:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment