Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> I think odd coding this was introduced recently because of the
> pg_resetxlog -> pg_resetwal renaming.
Dunno about that, but certainly somebody fat-fingered a refactoring
there. The 9.6 code looks quite different but doesn't seem to be
doing anything silly.
regards, tom lane