ChangeFeedProcessor: Fixes log during lease release #2764
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
During a normal split handling, the Change Feed Processor will create the child leases and delete the parent lease, after that, it releases the current Task processing the deleted lease.
The release process of a lease is generic, it can be called due to a transient error, due to an error processing the changes on the user code, etc.
Releasing a lease stops the processing Task and updates the lease document setting the Owner to
null
.In all cases, the lease exists, but on the case where a split happens, the lease is deleted by the split handling process. In this case, it is expected for the lease to not exist during the release.
During CTL validations, this causes an extra error log to be traced due to the exception (404), that is not an error in itself but expected. There is no error on the processing, but the noisy log could be interpreted as an error.
This PR just detects the known case and avoids the unnecessary exception log.