[DOCS-15125] [Server] compact no longer enters maintenance mode Created: 23/Feb/22  Updated: 13/Nov/23  Resolved: 30/Mar/22

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: 5.0.3, 4.4.9, 4.2.18, 5.1.0-rc0
Fix Version/s: 4.2.0, 4.4.0, 5.0.0, 5.2.0, 5.3.0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Edwin Zhou Assignee: Jason Price
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DOCS-14122 Add clarification about compact comma... Closed
is related to SERVER-55589 replSetMaintenance command does not t... Closed
Participants:
Days since reply: 1 year, 44 weeks ago
Epic Link: DOCSP-11701
Story Points: 3

 Description   

In our docs, we say that compact enters maintenance mode, or RECOVERING.
https://docs.mongodb.com/v5.0/reference/command/compact/#replica-sets

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.



 Comments   
Comment by Githook User [ 06/Apr/22 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-15125-compact-maintenance-mode (#880)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v6.0
https://github.com/10gen/docs-mongodb-internal/commit/27d08ff4b7732a2b2950979027935f74d3938297

Comment by Githook User [ 30/Mar/22 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-15125-compact-maintenance-mode (#880) (#896)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v5.2
https://github.com/10gen/docs-mongodb-internal/commit/c19b8ff3fbfb97c9a2edc35fe17b6bc066f0b584

Comment by Githook User [ 30/Mar/22 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-15125-compact-maintenance-mode (#880) (#895)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v5.0
https://github.com/10gen/docs-mongodb-internal/commit/e3a0a54e6cf0aa7b8a8f481b148ce4eb9bbcdb90

Comment by Githook User [ 30/Mar/22 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-15125-compact-maintenance-mode (#880) (#894)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v4.4
https://github.com/10gen/docs-mongodb-internal/commit/466abe8b2065bd3b21951747c6e95a32d2dc78c1

Comment by Githook User [ 30/Mar/22 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-15125-compact-maintenance-mode (#880) (#893)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v4.2
https://github.com/10gen/docs-mongodb-internal/commit/67968bbc015781965772d1448f8361f008e0cab3

Comment by Githook User [ 30/Mar/22 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-15125-compact-maintenance-mode (#880)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: master
https://github.com/10gen/docs-mongodb-internal/commit/27d08ff4b7732a2b2950979027935f74d3938297

Comment by Josef Ahmad [ 25/Feb/22 ]

Also, quoting the "Blocking" section:

compact does not block MongoDB CRUD Operations for the database it is currently operating on.

Before v4.4, compact blocked all operations for the database it was compacting, including MongoDB CRUD Operations, and was therefore recommended for use only during scheduled maintenance periods. Starting in v4.4, the compact command is appropriate for use at any time.

This section is potentially misleading. We know that on the secondary - which is where we recommend to run compact - compact is not appropriate for use at any time. If these considerations apply to primary, we should spell it out.

Comment by Josef Ahmad [ 25/Feb/22 ]

Note that while the secondary won't enter RECOVERING state, per SERVER-63973 it is nevertheless unable to replicate for the duration of the compact command. We haven't determined whether reads will succeed during compact; I think reads at a timestamp may stall behind the replication lag, and other reads may return stale data. I think we should specify that the secondary is still effectively operationally unavailable for the duration of compact.

Comment by Eric Milkie [ 23/Feb/22 ]

Right, sorry about that – we should have made a docs ticket from the final result of the changes from SERVER-55589.

Comment by Edwin Zhou [ 23/Feb/22 ]

cc milkie you might find this interesting given that you reported DOCS-14122.

Generated at Thu Feb 08 08:12:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.