[SERVER-15654] Can not initiate a replicaset with newly started mongodb with heap1 storage engine because it already contains data Created: 14/Oct/14  Updated: 11/Jul/16  Resolved: 05/Dec/14

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 2.7.6
Fix Version/s: 2.7.8

Type: Bug Priority: Major - P3
Reporter: Derick Rethans Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DRIVERS-190 Test against non-mmapv1 storage engine Closed
Operating System: ALL
Participants:

 Description   

When I do the following:

cd mongodb-linux-x86_64-2.7.6/bin
./mongod --port 27017 --storageEngine heap1 --replSet testing --fork --logpath=/tmp/heap1-1.log
./mongod --port 27018 --storageEngine heap1 --replSet testing --fork --logpath=/tmp/heap1-2.log
mongo --port 27017
rs.initiate( { _id: 'testing', members: [ { _id: 0, host: 'whisky:27017' }, { _id: 1, host: 'whisky:27018' } ] } );

I get the following error:

{
	"ok" : 0,
	"errmsg" : "member whisky:27018 has data already, cannot initiate set.  All members except initiator must be empty.",
	"code" : 13311
}

for some reason, it thinks that I already have data. There is indeed an empty ```admin``` database.



 Comments   
Comment by Ramon Fernandez Marina [ 05/Dec/14 ]

This issue no longer reproduces in 2.8.0-rc2; here's the modified test script I used:

#!/bin/bash
 
host="`uname -n`"
rm -rf data1 data2 
mkdir  data1 data2 
mongod --port 27017 --dbpath data1 --storageEngine inMemoryExperiment --replSet testing --fork --logpath=/tmp/heap1-1.log
mongod --port 27018 --dbpath data2 --storageEngine inMemoryExperiment --replSet testing --fork --logpath=/tmp/heap1-2.log
 
mongo --port 27017 --eval "rs.initiate( { _id: \"testing\", members: [ { _id: 0, host: \"$host:27017\" }, { _id: 1, host: \"$host:27018\" } ] } );"

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