The "we need history" state of the retried transaction may be different from
that of the original one due to reconfigurations, routing responses, etc.
Based on lp 3p1-rock branch, r9622.
int Adaptation::History::recordXactStart(const String &serviceId, const timeval &when, bool retrying)
{
- if (retrying) {
- Must(!theEntries.empty()); // or there would be nothing to retry
+ // the history will be empty on retries if it was enabled after the failure
+ if (retrying && !theEntries.empty())
theEntries.back().retried = true;
- }
+
theEntries.push_back(Adaptation::History::Entry(serviceId, when));
return theEntries.size() - 1; // record position becomes history ID
}