Adding Thread Safe ability on HaeinsaTransaction for Put / Delete / Get with different hTable#48
Adding Thread Safe ability on HaeinsaTransaction for Put / Delete / Get with different hTable#48ehudl wants to merge 2 commits intoVCNC:masterfrom
Conversation
|
How do you think about this scenario?
I think user would expect that value stored in key1 should be I'm now looking for how other transaction system handle this problem. |
|
Yes this is obviously a problem, but as I see it this is a wrong usage of the library. I made this ability to enable running a "command" where each command only works on it's own rows, and each command can run in a different thread. So maybe the definition of "thread safe" is not the best, but the point is working on multiple rows. As long as the rows are different you should be thread safe. The mutli-threaded ability we added was to optimize the bounding between I/O and CPU. We are optimizing the concurrency on the I/O. So this scenario is not possible in our system , but as I see it, this scenario is also not relevant. Maybe we should add better documentation or change the name of the Flag. Anyhow, we appreciate your advice. |
|
I added some code to protect this case. What do you think about this ? |
Currently we cannot run the following scenario:
Put / Delete / Get. // with the same transaction with different threads.
The fix I am suggesting will not change the current API at all, it will only add the ability to use some locks on mutation collections (using java.concurrent library).
I added a test to illustrate the scenario.
We would appreciate it if you would pull the attached code. Furthermore, any feedback would be welcome.
This change is