@Override
  protected void basicInvalidate(final EntryEventImpl event, boolean invokeCallbacks,
      final boolean forceNewEntry) throws EntryNotFoundException {
    Object key = event.getKey();
    if (key instanceof Long) {
      boolean removedFromAvID;
      Conflatable conflatable;
      conflatable = (Conflatable) get(key);
      removedFromAvID =
          !owningQueue.isPrimary() && owningQueue.destroyFromAvailableIDs((Long) key);
      if (!removedFromAvID) {
        return;
      }

      // <HA overflow>
      if (conflatable instanceof HAEventWrapper) {
        owningQueue.decAndRemoveFromHAContainer((HAEventWrapper) conflatable, "Invalidate");
      }
      // </HA overflow>
      // update the stats
      owningQueue.stats.incEventsExpired();
    }
    entries.invalidate(event, invokeCallbacks, forceNewEntry, false);

  }
Before invalidating , check if the entry being invalidated has a key as Long . If yes check if
the key is still present in availableIDs . If yes remove & allow invalidation to proceed. But
if the key (Long)is absent do not allow invalidation to proceed.

<p>
author Asif
geode-core/src/main/java/org/apache/geode/internal/cache/HARegion.java