When the node state is still REOVERING after restarting (code is here), we should not send query requests to the node. Otherwise, we will get "NotPrimaryOrSecondary" error.
We should wait for the node state becoming SECONDARY.
[js_test:upgrade_to_use_multitenancy_support] uncaught exception: Error: command failed: { [js_test:upgrade_to_use_multitenancy_support] "topologyVersion" : { [js_test:upgrade_to_use_multitenancy_support] "processId" : ObjectId("65eb9cfece2f2f03314ec2bb"), [js_test:upgrade_to_use_multitenancy_support] "counter" : NumberLong(2) [js_test:upgrade_to_use_multitenancy_support] }, [js_test:upgrade_to_use_multitenancy_support] "ok" : 0, [js_test:upgrade_to_use_multitenancy_support] "errmsg" : "node is recovering", [js_test:upgrade_to_use_multitenancy_support] "code" : 13436, [js_test:upgrade_to_use_multitenancy_support] "codeName" : "NotPrimaryOrSecondary" [js_test:upgrade_to_use_multitenancy_support] } with original command request: { [js_test:upgrade_to_use_multitenancy_support] "find" : "foo", [js_test:upgrade_to_use_multitenancy_support] "filter" : { [js_test:upgrade_to_use_multitenancy_support] [js_test:upgrade_to_use_multitenancy_support] }, [js_test:upgrade_to_use_multitenancy_support] "lsid" : { [js_test:upgrade_to_use_multitenancy_support] "id" : UUID("68ee955a-388e-464e-a1c7-b6da10b9d065") [js_test:upgrade_to_use_multitenancy_support] } [js_test:upgrade_to_use_multitenancy_support] }