src/backend/replication/logical/reorderbuffer.c
static void
ReorderBufferRestoreCleanup(ReorderBuffer *rb, ReorderBufferTXN *txn)
{
	XLogSegNo	first;
	XLogSegNo	cur;
	XLogSegNo	last;

	Assert(txn->first_lsn != InvalidXLogRecPtr);
	Assert(txn->final_lsn != InvalidXLogRecPtr);

	XLByteToSeg(txn->first_lsn, first);
	XLByteToSeg(txn->final_lsn, last);

	/* iterate over all possible filenames, and delete them */
	for (cur = first; cur <= last; cur++)
	{
		char		path[MAXPGPATH];
		XLogRecPtr	recptr;

		XLogSegNoOffsetToRecPtr(cur, 0, recptr);

		sprintf(path, "pg_replslot/%s/xid-%u-lsn-%X-%X.snap",
				NameStr(MyReplicationSlot->data.name), txn->xid,
				(uint32) (recptr >> 32), (uint32) recptr);
		if (unlink(path) != 0 && errno != ENOENT)
			ereport(ERROR,
					(errcode_for_file_access(),
					 errmsg("could not remove file \"%s\": %m", path)));
	}
}
/*
 * Remove all on-disk stored for the passed in transaction.
 */
Remove all on-disk stored for the passed in transaction.
Remove all on - disk stored for the passed in transaction .
static void
ReorderBufferRestoreCleanup(ReorderBuffer *rb, ReorderBufferTXN *txn)
{
	XLogSegNo	first;
	XLogSegNo	cur;
	XLogSegNo	last;
	Assert(txn->first_lsn != InvalidXLogRecPtr);
	Assert(txn->final_lsn != InvalidXLogRecPtr);
	XLByteToSeg(txn->first_lsn, first);
	XLByteToSeg(txn->final_lsn, last);
	for (cur = first; cur <= last; cur++)
	{
		char		path[MAXPGPATH];
		XLogRecPtr	recptr;
		XLogSegNoOffsetToRecPtr(cur, 0, recptr);
		sprintf(path, "pg_replslot/%s/xid-%u-lsn-%X-%X.snap",
				NameStr(MyReplicationSlot->data.name), txn->xid,
				(uint32) (recptr >> 32), (uint32) recptr);
		if (unlink(path) != 0 && errno != ENOENT)
			ereport(ERROR,
					(errcode_for_file_access(),
					 errmsg("could not remove file \"%s\": %m", path)));
	}
}
static void ReorderBufferRestoreCleanup ( ReorderBuffer * rb , ReorderBufferTXN * txn ) { XLogSegNo first ; XLogSegNo cur ; XLogSegNo last ; Assert ( txn -> first_lsn != InvalidXLogRecPtr ) ; Assert ( txn -> final_lsn != InvalidXLogRecPtr ) ; XLByteToSeg ( txn -> first_lsn , first ) ; XLByteToSeg ( txn -> final_lsn , last ) ; for ( cur = first ; cur <= last ; cur ++ ) { char path [ MAXPGPATH ] ; XLogRecPtr recptr ; XLogSegNoOffsetToRecPtr ( cur , 0 , recptr ) ; sprintf ( path , " " , NameStr ( MyReplicationSlot -> data . name ) , txn -> xid , ( uint32 ) ( recptr >> 32 ) , ( uint32 ) recptr ) ; if ( unlink ( path ) != 0 && errno != ENOENT ) ereport ( ERROR , ( errcode_for_file_access ( ) , errmsg ( " \" \" " , path ) ) ) ; } }
Remove all on-disk stored for the passed in transaction.
Remove all on - disk stored for the passed in transaction .
/* iterate over all possible filenames, and delete them */