One concern:

  if (should_stop_conflict_info_retention(rdt_data))
+ {
+ /*
+ * Stop retention if not yet. Otherwise, reset to the initial phase to
+ * retry all phases. This is required to recalculate the current wait
+ * time and resume retention if the time falls within
+ * max_retention_duration.
+ */
+ if (MySubscription->retentionactive)
+ rdt_data->phase = RDT_STOP_CONFLICT_INFO_RETENTION;
+ else
+ reset_retention_data_fields(rdt_data);
+
  return;
+ }

 Instead of above code changes, shall we have:

 if (should_stop_conflict_info_retention(rdt_data))
     rdt_data->phase = RDT_STOP_CONFLICT_INFO_RETENTION;  (always)

And then stop_conflict_info_retention() should have these checks:

if (MySubscription->retentionactive)
{
    ...update flag and perform stop (current functionality)
}
else
{
        
Assert(!TransactionIdIsValid(MyLogicalRepWorker->oldest_nonremovable_xid));
        reset_retention_data_fields(rdt_data);
}

thanks
Shveta


Reply via email to