// sure that we don't touch any partition other than our local one. If we do, then we need abort
// it and restart it as multi-partitioned
boolean need_restart = false;
boolean predict_singlepartition = ts.isPredictSinglePartition();
PartitionSet done_partitions = ts.getDonePartitions();
Estimate t_estimate = ts.getLastEstimate();
// Now we can go back through and start running all of the WorkFragments that were not blocked
// waiting for an input dependency. Note that we pack all the fragments into a single
// CoordinatorFragment rather than sending each WorkFragment in its own message
for (WorkFragment.Builder fragmentBuilder : fragmentBuilders) {
assert(this.depTracker.isBlocked(ts, fragmentBuilder) == false);
final int target_partition = fragmentBuilder.getPartitionId();
final int target_site = catalogContext.getSiteIdForPartitionId(target_partition);
final PartitionSet doneNotifications = (notify != null ? notify.getNotifications(target_site) : null);
// Make sure that this isn't a single-partition txn trying to access a remote partition
if (predict_singlepartition && target_partition != this.partitionId) {
if (debug.val)
LOG.debug(String.format("%s - Txn on partition %d is suppose to be " +
"single-partitioned, but it wants to execute a fragment on partition %d",
ts, this.partitionId, target_partition));
need_restart = true;
break;
}
// Make sure that this txn isn't trying to access a partition that we said we were
// done with earlier
else if (done_partitions.contains(target_partition)) {
if (debug.val)
LOG.warn(String.format("%s on partition %d was marked as done on partition %d " +
"but now it wants to go back for more!",
ts, this.partitionId, target_partition));
need_restart = true;
break;
}
// Make sure we at least have something to do!
else if (fragmentBuilder.getFragmentIdCount() == 0) {
LOG.warn(String.format("%s - Trying to send a WorkFragment request with 0 fragments", ts));
continue;
}
// Add in the specexec query estimate at this partition if needed
if (hstore_conf.site.specexec_enable && t_estimate != null && t_estimate.hasQueryEstimate(target_partition)) {
List<CountedStatement> queryEst = t_estimate.getQueryEstimate(target_partition);
// if (debug.val)
if (target_partition == 0)
if (debug.val)
LOG.debug(String.format("%s - Sending remote query estimate to partition %d " +
"containing %d queries\n%s",