TestReplication#testNoExtraReplicationWhenBlockReceivedIsLate failed in several Jenkins run (e.g., https://builds.apache.org/job/PreCommit-HDFS-Build/13818/testReport/). The failure is on the last assertNoReplicationWasPerformed check.
This test failure reveals a scenario that
HDFS-1172 missed: if a block is first committed by the client, and then the first IBR comes to the NN, as proposed by HDFS-1172, we should still put the remaining expected replicas into the pending queue, instead of the under-replicated queue. Please see Mingliang Liu's comment here for more details.