[CONTROLLER-1624] DistributedShardChangePublisher seems to be vulnerable to shard's data tree change events ordering Created: 30/Mar/17 Updated: 25/Jul/23 Resolved: 27/Apr/17 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | clustering |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Jakub Morvay | Assignee: | Jakub Morvay |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 8116 |
| Description |
|
The scenario is as follows. We have a DistributedShardChangePublisher that listens on shard's data tree change events and this shard has also some subshards. Then it seems that we are assuming that the DistributedShardChangePublisher will be notified with shard's data tree change event before any data tree change event from subshards. Clearly we cannot assure that. |
| Comments |
| Comment by Robert Varga [ 12/Apr/17 ] |
|
Right, so we need to stage the logic such that it has an initial phase when it records changes from subshards and only switches to assembling the data once it has observed the change from its own data tree. |
| Comment by Jakub Morvay [ 12/Apr/17 ] |
|
(In reply to Robert Varga from comment #1) Yeah, I was thinking about something similar. But we cannot know if there are any changes in subshards at all, so we cannot really wait for them (at least with current shard's data tree change listeners implementation). Another approach could be something like "caching" changes from subshards. If the change from subshard cannot be processed, because the change from shard's own data tree is still missing, we can just postpone processing of this change from subshard. Once we get the change event also for shard's own data tree, we can try to assemble the data also with cached changes from subshards. But this has to be thought trough in more detail. |
| Comment by Tom Pantelis [ 12/Apr/17 ] |
|
This has come up in general with DTCLs, ie the fact that it doesn't notify initially if there's no data. We could pretty easily change the backend to pass an empty change list but it technically breaks the DTCL API contract as it states that the passed list won't be empty. Perhaps we should just address this in Nitrogen. It would really simplify the blueprint clustered-app-config as well. (In reply to Jakub Morvay from comment #2) |
| Comment by Jakub Morvay [ 24/Apr/17 ] |
| Comment by Jakub Morvay [ 26/Apr/17 ] |