Replication replay threads should block replaying operations when they detect that the server and/or backend is read-only. Currently the operation fails with UNWILLING_TO_PERFORM (if server is read-only) or NO_SUCH_OBJECT (if backend is unavailable due to e.g. rebuild).
There are a couple of difficulties here:
1) What should the replay thread do when it detects that the operation cannot be replayed? Should it back off for a short period and retry? How long should it continue trying, knowing that tasks such as rebuild index may take quite a long time?
2) How should a replay thread detect that a backend is only temporarily offline due to import/rebuild? There is no way currently to distinguish between a backend which is temporarily offline and one which has been removed altogether, since both require that the backend be disabled in the configuration. We had hoped to address this class of problem (separation of config and state) in 3.0.