Test cases in resharding_oplog_crud_application_test.cpp provide coverage of the idempotency for single operations. Before introducing various stepdown suites with the resharding fuzzer, it would be helpful to confirm there are no issues with idempotency of sequences of multiple operations. One thought is to add a failpoint which causes ReshardingOplogApplier::_applyBatch() to be called twice with the same batch. This failpoint should be enabled in a new resharding fuzzer task which runs with --numDonors 3 --numRecipients 3 --inPlace yes. For example:
- <<: *jstestfuzz_template name: resharding_fuzzer_idempotency_gen tags: ["resharding_fuzzer"] commands: - func: "generate fuzzer tasks" vars: <<: *jstestfuzz_config_vars num_files: 10 num_tasks: 5 npm_command: resharding-fuzzer jstestfuzz_vars: --numDonors 3 --numRecipients 3 --inPlace yes suite: resharding_fuzzer resmoke_args: --storageEngine=wiredTiger --mongodSetParameters='{"failpoint.reshardingApplyBatchTwice": {mode: "alwaysOn"}}' name: resharding_fuzzer_idempotency
Another option would be to have the failpoint enabled in the ReshardingTest fixture via a TestData parameter which is set in a new resharding_fuzzer_idempotency.yml test suite so engineers don't need to specify --mongodSetParameters to run the configuration locally.