I add my fix code which in the patch. The code fix the origin problem, but it failed for the following new reason.
TRAP: FailedAssertion("TransactionIdPrecedesOrEquals(safeXid, snap->xmin)", File: "snapbuild.c", Line: 593, PID: 1576)
postgres: master: walsender postgres [local] CREATE_REPLICATION_SLOT(ExceptionalCondition+0xb9)[0xb1ca28]
postgres: master: walsender postgres [local] CREATE_REPLICATION_SLOT(SnapBuildInitialSnapshot+0x1b3)[0x8f3c79]
postgres: master: walsender postgres [local] CREATE_REPLICATION_SLOT[0x9136b9]
postgres: master: walsender postgres [local] CREATE_REPLICATION_SLOT(exec_replication_command+0x398)[0x91456a]
postgres: master: walsender postgres [local] CREATE_REPLICATION_SLOT(PostgresMain+0x7be)[0x984e4a]
postgres: master: walsender postgres [local] CREATE_REPLICATION_SLOT[0x8c0d5b]
postgres: master: walsender postgres [local] CREATE_REPLICATION_SLOT[0x8c06cd]
postgres: master: walsender postgres [local] CREATE_REPLICATION_SLOT[0x8bc9de]
postgres: master: walsender postgres [local] CREATE_REPLICATION_SLOT(PostmasterMain+0x117a)[0x8bc2b5]
postgres: master: walsender postgres [local] CREATE_REPLICATION_SLOT[0x7bdb13]