public void addReplica(Replica replica, boolean updateInvertedIndex) {
        try (CloseableLock ignored = CloseableLock.lock(this.rwLock.writeLock())) {
            if (deleteRedundantReplica(replica.getBackendId(), replica.getVersion())) {
                replicas.add(replica);
                if (updateInvertedIndex) {
                    GlobalStateMgr.getCurrentState().getTabletInvertedIndex().addReplica(id, replica);
                }
            }
        }
    }
@Test
    public void testGetColocateHealthStatus() throws Exception {
        LocalTablet tablet = new LocalTablet();
        Replica versionIncompleteReplica = new Replica(1L, 10001L, 8,
                -1, 10, 10, ReplicaState.NORMAL, 9, 8);
        Replica normalReplica = new Replica(1L, 10002L, 9,
                -1, 10, 10, ReplicaState.NORMAL, -1, 9);
        tablet.addReplica(versionIncompleteReplica, false);
        tablet.addReplica(normalReplica, false);
        Assert.assertEquals(LocalTablet.TabletHealthStatus.COLOCATE_REDUNDANT,
                TabletChecker.getColocateTabletHealthStatus(
                        tablet, 9, 1, Sets.newHashSet(10002L)));
    }