-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
YCSB+T: Added transactions to DB and DBWrapper and validate() to Workloa... #169
base: master
Are you sure you want to change the base?
Conversation
…load. YCSB+T: Added an example ClosedEconomyWorkload with a simple implementation of validate and a Simple Anomaly Score.
Fixes MongoExceptions that were being raised previously
This branch fixes two bugs in MongoDbClient: ClassCastExceptions raised due to the incorrect handling of field values returned by database queries in read() MongoExceptions raised due to attempts to update the _id field value in update()
The return value of DB.update() was previously unchecked in ClosedEconomyWorkload.doTransactionReadModifyWrite(), leading DB.abort() not being called when a transaction failed half-way
Check DB.update() return value in ClosedEconomyWorkload.doTransactionReadModifyWrite()
Fix variable swap bug so that ClosedEconomyWorkload only moves money from higher-numbered accounts/keys to lower-numbered accounts/keys
bump on this issue. would like to see this resolved for the Sep release. |
since this changes the core binding definition it'll probably take some work to get right. /cc @allanbank since the patch as is touches the Mongo code, though I've no reason to believe it will need substantially different handling than other datastores. open quesiton: if we have commit / abort, what do we do with datastores that have no notion of transactions? |
The default start(), commit() and abort() are defined as empty methods in DB.java. This is similar to the cleanup() and init() default implementations. |
ah. and the default consistency check just says yes blindly. I see. could merge that with the new verify stuff in core workload. thanks for the pointer! |
Conflicts: core/src/main/java/com/yahoo/ycsb/Client.java core/src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java
I have merged the changes but the verification code is not fully integrated yet. I'd be happy to help with it. |
} | ||
catch (InterruptedException e) | ||
{ | ||
// do nothing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably wrong. we should at a minimum set the interrupted status of the thread.
please don't include additional format fixes, it makes it harder to review the substance of the change. |
//and the sleep() doesn't make sense for granularities < 1 ms anyway | ||
if ( (_targetOpsPerMs>0) && (_targetOpsPerMs<=1.0) ) | ||
{ | ||
sleep(Utils.random().nextInt((int)(1.0/_targetOpsTickNs))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks unrelated to the change mentioned in the PR description, could you leave it out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the format changes. I could merge it again if that helps.
It seems like the update operations reset records to the initial value (totalcash / recordcount), if there has been a readmodifywrite performed on the record then it seems like this breaks the closed economy invariant. |
Merge latest upstream YCSB commits into YCSB+T
Please review the recent changes and let me know if you want me to address anything. |
@akon-dey I wrote a very similar It would be nice to have this in your implementation too. I could submit a pull request if you think this is worthwhile? |
This would be useful. We should be able to set the isolation level using the workload configuration properties file. That will make it truly usable. |
Please submit a pull request with the ability to set the workload properties. |
Hello @akon-dey . Have you noticed the behavior of ycsb+t when running the load phase (in the ClosedEconomyWorkload layer) using the parameter w = 0 in the mongo db cluster? It simply gives a NumberFormatException error on the last record (in the ClosedEconomyWorkload layer). I'm running on Mongodb Atlas and I noticed this error doing tests. Do you have any idea about this behavior? |
@morcelicaio I have not experienced it. If you can send me a stack or better, a pull request, I would be happy to incorporate it. |
@akon-dey , I did some more tests on another computer and didn't get the same error. Maybe it could have been some point on the other machine. If I get the same error again, I'll let you know. Thanks! |
@morcelicaio I don't believe it was merged. There were some changes to the PR that had questions and hence not merged. One was code format related and the other was regarding completeness of the ClosedEconomyWorkload. The first was trivial and the second was not intended to be addressed by the code. It would be best to recreate the PR to address the first issue and merge if it looks good. |
it has not yet been merged. There's also merge conflicts, so it will need to go through a rebase before review. |
Hello guys, @busbey, @akon-dey . Regarding YCSB+T, he talks about evaluating the transactional part of NoSQL databases. I'm still testing with MongoDB. Do I need to implement this code to use YCSB+T? Thanks |
I would assume that if you don't see the mongo transaction API being called then probably the existing code is not making use of it. |
Just that, @busbey . So how does YCSB+T assess transactional overhead and have a layer to assess transactional consistency when the transaction code implementation is not in the YCSB+T code? It's a question that maybe other users have as well. |
as mentioned previously, this proposed change hasn't been merged yet. It also started in 2014, so it's possible it predates the mongo transactional api. |
...d.
YCSB+T: Added an example ClosedEconomyWorkload with a simple implementation of validate and a Simple Anomaly Score.