I wrote:
> Okay, but you failed to correctly reproduce the conditions for closing
> the old file.
A more bulletproof solution might involve passing sync_method to
get_sync_bit as an explicit parameter, and then the assign hook
could doif (get_sync_bit(sync_method) != get_sync_bit(new_sync_method)) XLogFileClose();
regards, tom lane