- if (payload instanceof DataTreeCandidateSupplier) {
- final Entry<Optional<TransactionIdentifier>, DataTreeCandidate> e =
- ((DataTreeCandidateSupplier)payload).getCandidate();
-
- DataTreeCandidates.applyToModification(transaction, e.getValue());
- size++;
-
- if (e.getKey().isPresent()) {
- // FIXME: BUG-5280: propagate transaction state
- }
- } else {
- log.error("{}: Unknown payload {} received during recovery", shardName, payload);
- }
- } catch (IOException e) {
- log.error("{}: Error extracting payload", shardName, e);
+ store.applyRecoveryPayload(payload);
+ } catch (Exception e) {
+ log.error("{}: failed to apply payload {}", shardName, payload, e);
+ throw new IllegalStateException(String.format("%s: Failed to apply recovery payload %s",
+ shardName, payload), e);