Completely revamped the internal dependency management code for distributed transactions. I extracted out all of the code for tracking dependencies that was inside of LocalTransaction and moved it into a new class called DependencyTracker.
This will make it easier for us be able to embed prefetched query results without a ton of extra data structures. I moved the lock out of ExecutionState and into LocalTransaction. I think that eventually we can get rid of the ExecutionState entirely...

KB went to a Providence Bruins hockey game. I'm hanging out working on my database listening to baseballs. It's a cool/rainy Saturday night... Pimps up, hoes down I suppose... #125
Forgot to add the ability to create/remove txn states in the DependencyTracker #125
Added in the ability to create/remove txns from the DependencyTrackers in the proper places. We only need to do it for distributed txns when they actually try to execute work on remote partitions #125
Fixed up LocalTransaction.startRound() so that we invoke the DependencyTracker if we're in a dtxn or a *sysproc*. This seems to be working nicely now...
So we have a problem where we are not using the DependencyTracker for single-partition nodes... this is why the tests are failing. I will fix tomorrow morning
Added hackish workarounds for dealing with updates on replicated tables when there is only one partition
Working on adding support for prefetching in the new DependencyTracker. So I figured out that we'll be able to prefetch PlanFragments for multi-partition queries... Still need to sort out some things like how to identify that we prefetched a query in the PartitionExecutor so that we don't send duplicate requests and how to recognize that it's okay that we executed queries out of order on remote partitions. KB made dinner so I'm going downstairs now. I'll be back in a bit... #125
Forgot to add in extract QueryInvocation class
Removed the DependencyTracker handle out of ExecutionState and put it into the LocalTransaction handle. We will probably be able to get rid of ExecutionState entirely now #125
Working on test case for adding prefetching results in the DependencyTracker before/after they are needed by txns. Removed the 'predict_singlePartitioned' input parameter to BatchPlanner.plan(). I forget why we had it in the first place. #125
I figured out how we can override internal dependency information to use a prefetch DependencyInfo, but now I realize that this isn't the way we want to do it because we actually need to call addResult() so that we can unblock things properly... Still a work in progress #125
Ok I think we're on to something here. We can now successfully switch a DependencyInfo from 'prefetch mode' into 'regular mode' so that the results cause other WorkFragments to get unblocked. The major issue that remains is how we identify when a prefetch DependencyInfo corresponds to an actual invoked query. Right now we're using stmtIndex, which is incorrect because that is on a per batch basis. #125
Added a new test case that checks whether we can get unblocked successfully if the prefetch result arrives *after* the SQLStmt batch has been issued with the prefetched query in it #125
Commented out the SQLStmt index tracking stuff in the DependencyTracker. It's funny how putting all of this logic into a single location makes it easier to see what is actually not needed at all...
Simple fix for TestHStoreCoordinator and other failing tests
Make sure that PartitionExecutor.executeLocalPlan() uses LocalTransaction.initFirstRound()
Make sure that we tell the DependencyTracker about our txn if it needs to know about it
Simple fix for the initialization ordering of HStoreSite and PartitionExecutor
Another simple fix for a failing TestBatchPlanner test case
Fixes from last night that I forgot to commit. Mostly minor refactoring/reformatting