-
Notifications
You must be signed in to change notification settings - Fork 23
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
IDs are not necessarily unique #2
Comments
I pushed a new version to address this (0.8-2). The problem was that the resty-mongol driver was getting the process id from the master nginx process instead of the process id from the worker processes. Try it out! |
@wglasshusain Did you get a chance to see if this takes care of your issue? |
Not yet -- will try it out in the next few days. Thanks! WGH On Mon, Oct 20, 2014 at 3:29 PM, Robert Andrew Ditthardt <
William Glass-Husain /forio | +1 (415) 440 7500 x89 | forio.com |
Sadly, my test code still shows this error. I confirmed my vagrant box has only resty-mongol 0.8-2 installed. Rapidly generating 100 records still generates some records with conflicting ids. |
Hi,
I've got a web service (written in Lusty, using lusty-store-mongo) which creates records in MongoDb.
When i call the web service repeatedly to create records for the same collection and return the id from MongoDb, I see that the object id sometimes repeats.
I wrote a test in Java to rapidly call my web service to repeatedly create records and output the id. Out of every 100 queries, I get 2-10 that have dup ids.
Example (first 10 records created). You can see the 6th id is the same as the first.
The web service itself is simple. It does the following
store is a Lusty store object. After this bit of code, it returns record._id.
Looking at the Mongol code, I see that the id includes a timestamp and also a incrementing number. I hypothesize that the number is not correctly incrementing, and that creating a bunch of records in a short time can generate the same id. Does this seem plausible?
It's possible that the issue is also in lusty-store-mongo. I am currently attempting to duplicate this in a test which calls Mongol Resty driver directly, but my Lua skills are a bit rusty and I haven't pulled together the Busted test yet.
The text was updated successfully, but these errors were encountered: