Support marking a transaction read-only in TransactionManager
Currently all transactions write a log entry on commit. TransactionManager
should support beginning a read-only transaction. This is useful for performance and observability. As read-only transactions don't make any changes, we can skip writing a log entry for them. This could be currently achieved by rolling back the transaction but that would skew metrics if we measure commit/rollbacks to observe the success rate of transactions. As we don't write log entries for read only transactions, an error should be raised if the transaction had some changes recorded when it commits.
Read only transactions should also not be configured with a quarantine. This is needed for some RPCs which care about the difference between object directories and alternates, such as Fsck
which only checks the object directory. If the repository is quarantined, the actual object directory wouldn't be checked. The RPC is read-only so foregoing the quarantine creation allows it to check the actual object directory.