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:
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.LatestVersionhere, but that is then getting mapped to a value for ChangeFeedIncremental, here.
When a legacy document is encountered, the mode is defaulted to LatestVersionhere, which doesn't match anymore due to the remapping that took place in between.
Describe the bug After upgrading to 3.39.0 of the SDK, services using ChangeFeedProcessorBuilder are throwing an exception with the description:
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:
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 toChangeFeedMode.LatestVersion
here, but that is then getting mapped to a value forChangeFeedIncremental
, here. When a legacy document is encountered, the mode is defaulted toLatestVersion
here, which doesn't match anymore due to the remapping that took place in between.