// We will send a prepare message to all of our remote HStoreSites
// The coordinator needs to be smart enough to know whether a txn
// has already been marked as prepared at a partition (i.e., it's gotten
// responses).
PartitionSet partitions = ts.getPredictTouchedPartitions();
LocalPrepareCallback callback = ts.getPrepareCallback();
this.hstore_coordinator.transactionPrepare(ts, callback, partitions);
if (hstore_conf.site.exec_profiling) this.profiler.network_time.stopIfStarted();
ts.getDonePartitions().addAll(partitions);
}
// -------------------------------
// ABORT: Distributed Transaction
// -------------------------------
else {
// Send back the result to the client right now, since there's no way
// that we're magically going to be able to recover this and get them a result
// This has to come before the network messages above because this will clean-up the
// LocalTransaction state information
this.hstore_site.responseSend(ts, cresponse);
// Send a message all the partitions involved that the party is over
// and that they need to abort the transaction. We don't actually care when we get the
// results back because we'll start working on new txns right away.
// Note that when we call transactionFinish() right here this thread will then go on
// to invoke HStoreSite.transactionFinish() for us. That means when it returns we will
// have successfully aborted the txn at least at all of the local partitions at this site.
if (hstore_conf.site.txn_profiling && ts.profiler != null) ts.profiler.startPostFinish();
LocalFinishCallback callback = ts.getFinishCallback();
callback.init(ts, status);
if (hstore_conf.site.exec_profiling) this.profiler.network_time.start();
try {
this.hstore_coordinator.transactionFinish(ts, status, callback);
} finally {
if (hstore_conf.site.exec_profiling) this.profiler.network_time.stopIfStarted();