Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unique Background Indexes #1216

Open
angelo0000 opened this issue Feb 15, 2015 · 5 comments
Open

Unique Background Indexes #1216

angelo0000 opened this issue Feb 15, 2015 · 5 comments

Comments

@angelo0000
Copy link

I am trying to work on a migration from my existing mongo 2.4.x to TokuMX and noticed some odd behavior. My application is a node app that leverages Mongoose as the ORM. When my server starts, I see all my ensure indexes fire off as I would expect when pointing to a vanilla mongo setup. When I point it at a toku instance I don't see all my indexes being created.

After some digging it looks like TokuMX complains when you try to create a unique index that is set to background true. Why is that? Mongo 2.4.x does not have this issue.

I also found this: #1091 (this is the issue where this behavior was added to toku).

@angelo0000
Copy link
Author

It says in the docs for 2.4 that mongo can create multiple bg indexes now without a problem: http://docs.mongodb.org/v2.4/core/index-creation/#behavior

@angelo0000
Copy link
Author

I just setup a docker image with mongo 2.6 and one with mongo 3.0rc8 and it seems it is behaving like toku... not sure what is different in 2.4 vs 2.6+ that would cause this.

@michaeldauria
Copy link

This is b/c a unique index requires a collection lock, therefore rather than locking up and not telling you, it won't let you get into a bad situation.

@angelo0000
Copy link
Author

I'm not following you... At the time I wrote this Toku was based on Mongo 2.4 which does allow a unique index to be created as background true. Here is the link to the does that explain this behavior: http://docs.mongodb.org/v2.4/core/index-creation/#behavior

@angelo0000
Copy link
Author

Maybe 2.4 just ignored the bg true and did it in the foreground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants