[SERVER-82939] CollectionRoutingInfoTargeter should not be notified of errors on a different namespace Created: 08/Nov/23  Updated: 23/Nov/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Allison Easton Assignee: Backlog - Catalog and Routing
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Catalog and Routing
Participants:
Story Points: 2

 Description   

When performing a batch write and a routing or collection creation error is encountered, the entire batch is cancelled because we know that all subsequent writes will also fail with the same error. This error is then duplicated to fill the responses of all the writes that were not attempted. We then update errorsPerNamespace using the namespace of the write and the error we just duplicated.

In the case that there are writes to multiple namespaces in the bulk write, this may result in an error for one namespace being added to errorsPerNamespace for another namespace. This then causes the bulk write executor to note error responses on targeters of namespaces that didn't actually have an error response.

The collection routing info targeter should not have to be responsible for checking if the error it is being notified belongs to the correct namespace - this should be handled by the bulk write executor.

One possibility would be to leave the error duplication so that the write operations are correctly marked for retry but to not add these errors to errorsPerNamespace if they do not actually match the namespace.



 Comments   
Comment by Allison Easton [ 16/Nov/23 ]

No, it isn't a correctness issue. Just something that came out of a PR as an improvement

Generated at Thu Feb 08 06:50:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.