In our docs, we say that compact enters maintenance mode, or RECOVERING.
On secondaries, the compact command forces the secondary to enter RECOVERING state. Read operations issued to an instance in the RECOVERING state will fail. This prevents clients from reading during the operation. When the operation completes, the secondary returns to SECONDARY state.
See Replica Set Member States for more information about replica set member states.
SERVER-55589 causes replSetMaintenance to take the RSTL, and we decided compact should no longer enter maintenance mode. Therefore, we no longer see a replica set state change from SECONDARY to RECOVERING.
The assertion about compact entering RECOVERING is no longer accurate.