Skip to content

Commit 14d7c8b

Browse files
committed
Only use mmapv1 args for mmap storage engine
1 parent 7189b37 commit 14d7c8b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

mgo.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ import (
3131
"github.com/juju/errors"
3232
"github.com/juju/loggo"
3333
"github.com/juju/retry"
34-
jc "github.com/juju/testing/checkers"
3534
"github.com/juju/utils/v2"
3635
"github.com/juju/version"
3736
gc "gopkg.in/check.v1"
3837
"gopkg.in/mgo.v2"
3938
"gopkg.in/mgo.v2/bson"
39+
40+
jc "github.com/juju/testing/checkers"
4041
)
4142

4243
var (
@@ -45,7 +46,7 @@ var (
4546
logger = loggo.GetLogger("juju.testing")
4647

4748
// regular expression to match output of mongod
48-
waitingForConnectionsRe = regexp.MustCompile(".*waiting for connections.*")
49+
waitingForConnectionsRe = regexp.MustCompile(".*[W|w]aiting for connections.*")
4950

5051
mongo32 = version.Number{Major: 3, Minor: 2}
5152

@@ -287,9 +288,6 @@ func (inst *MgoInstance) run() error {
287288
mgoargs := []string{
288289
"--dbpath", inst.dir,
289290
"--port", mgoport,
290-
"--nssize", "1",
291-
"--noprealloc",
292-
"--smallfiles",
293291
"--oplogSize", "10",
294292
"--ipv6",
295293
"--setParameter", "enableTestCommands=1",
@@ -330,6 +328,10 @@ func (inst *MgoInstance) run() error {
330328
storageEngine := mongoStorageEngine(inst.EnableReplicaSet)
331329
if storageEngine != "" {
332330
mgoargs = append(mgoargs, "--storageEngine", storageEngine)
331+
if storageEngine == "mmapv1" {
332+
mgoargs = append(mgoargs, "--nssize", "1")
333+
mgoargs = append(mgoargs, "--noprealloc", "--smallfiles")
334+
}
333335
}
334336
}
335337

0 commit comments

Comments
 (0)