[SERVER-21680] Cannot drop oplog.$main Created: 26/Nov/15  Updated: 07/Jan/16  Resolved: 07/Jan/16

Status: Closed
Project: Core Server
Component/s: Admin, Replication
Affects Version/s: 3.0.6
Fix Version/s: None

Type: Question Priority: Minor - P4
Reporter: Marek Jurco Assignee: Stennie Steneker (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DOCS-6658 Steps for converting master/slave dep... Closed
Participants:

 Description   

After converting master/slave replication to replica set (as described on https://docs.mongodb.org/manual/core/master-slave/#convert-a-master-slave-deployment-to-a-replica-set), I cannot drop local.oplog.$main collection:

Error: drop failed:

{ "ok" : 0, "errmsg" : "can't drop collection with reserved $ character in name" }

I need to drop it since
1. it has allocated around 4 GB of space
2. it is not needed (local.oplog.rs used instead)
Renaming an oplog is not possible.

Could you please advise on how to drop it?

Thank you.



 Comments   
Comment by Stennie Steneker (Inactive) [ 27/Nov/15 ]

Hi Marek,

It looks like the procedure for converting a master/slave deployment to a replica set is missing a step to remove the local database before initiating the replica set.

Since newer versions of the MongoDB server have stronger enforcement for collection name validation, there isn't a straightforward way to drop or rename local.oplog.$main because it includes a reserved character ($).

A suggested workaround is to re-sync a replica set member that still has the old local.oplog.$main collection.

Regards,
Stephen

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