This will presumably NPE if the replica set is null (i.e. if replica set is not enabled). Do we have an integration test for that use-case, which fails with this NPE? If not, we should add one.