[SERVER-29451] add hooks to the mock storage engine to be able to expect reads and writes, similar to the mock network interface's onCommand* Created: 05/Jun/17 Updated: 06/Dec/22 Resolved: 23/Feb/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 3.5.8 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Esha Maharishi (Inactive) | Assignee: | [DO NOT USE] Backlog - Sharding Team |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | todo_in_code | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Sharding
|
| Participants: |
| Description |
|
This becomes more relevant as sharding catalog operations move to being performed locally by the config server rather than over the network. While sharding catalog operations were performed by mongos against the config server, unit tests could use the mock network interface's "onCommand*" methods to "expect" (block and wait for) certain reads/writes to be sent over the network from mongos to the config server. Now that mongod performs these operations locally, it'd be nice to have a way to tell the mock storage engine to similarly "expect" read/write operations to be performed against it. It may also be a valuable feature for unit testing transactions and retriable writes local read/write logic. |
| Comments |
| Comment by Andy Schwerin [ 06/Jun/17 ] |
|
That's probably possible, and not a ton of work. |
| Comment by Esha Maharishi (Inactive) [ 06/Jun/17 ] |
|
(As long as the registered OpObserver was able to signal to the main thread that it had run, and communicate the observed op back to the main thread). |
| Comment by Esha Maharishi (Inactive) [ 06/Jun/17 ] |
|
Yep, I think that would be equally viable and probably cleaner. |
| Comment by Andy Schwerin [ 05/Jun/17 ] |
|
If OpOberver were a real registry of operation observers, could you do this by registering an OpObserver in your test? |