Sample stacktrace:
This was broken by YARN-3736. The recovery code is seeking to the RM_RESERVATION_KEY_PREFIX but failing to verify that the keys it sees in the loop actually have that key prefix. Here's the relevant code:
iter = new LeveldbIterator(db);
iter.seek(bytes(RM_RESERVATION_KEY_PREFIX));
while (iter.hasNext()) {
Entry<byte[],byte[]> entry = iter.next();
String key = asString(entry.getKey());
String planReservationString =
key.substring(RM_RESERVATION_KEY_PREFIX.length());
String[] parts = planReservationString.split(SEPARATOR);
if (parts.length != 2) {
LOG.warn("Incorrect reservation state key " + key);
continue;
}
The only way to terminate this loop is when the iterator runs out of keys, therefore the iteration loop will scan through all the keys in the database starting at the reservation key to the end. If any key encountered is too short then we'll get the out of bounds exception when we try to do the substring.
Pinging adhoot and asuresh who were involved in YARN-3736.
Sample stacktrace:
This was broken by
YARN-3736. The recovery code is seeking to the RM_RESERVATION_KEY_PREFIX but failing to verify that the keys it sees in the loop actually have that key prefix. Here's the relevant code:The only way to terminate this loop is when the iterator runs out of keys, therefore the iteration loop will scan through all the keys in the database starting at the reservation key to the end. If any key encountered is too short then we'll get the out of bounds exception when we try to do the substring.
Pinging adhoot and asuresh who were involved in
YARN-3736.