Prevent duplicate uri property update #1003
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.
Summary
Uri subscriber can receive duplicate uri properties during INDIS migration as both ZK data and Kafka data are input on INDIS Observer (using ZK data to cover server apps that don't emit or partially emit kafka data). Since Kafka data has higher precedence, when Kafka data arrives later than ZK data, it will be sent to the client although the uri properties inside is effectively the same as ZK data, which is still needed, since the metadata is different, like tracing ID, modified time, etc, the client will send tracking events of receipt to track the end-to-end propagation latency for Kafka announcements.
This change only prevents uri subscriber from processing the inner duplicate uri properties as an update, which will prevent all subsequent actions taken by the uri property listeners. (note: there are other edge cases of receiving duplicate uri properties, such as when the version in the uri properties is incremented but the data is unchanged. This change generally protect against all of them and can help us investigate such case in the future)
Testing Done
QEI deployed indis-canary, restart indis-canary backend (which will trigger uri property update with markdowns then back up. When uri is back up, the client will receive it twice), look for logs "received duplicate uri properties" by UriLoadBalancerSubscriber (set log level INFO)
indis-canary.log