diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/KeyValueContainerUtil.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/KeyValueContainerUtil.java index c0e7d7847c..2c02ad5654 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/KeyValueContainerUtil.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/KeyValueContainerUtil.java @@ -198,8 +198,9 @@ public final class KeyValueContainerUtil { kvContainerData.setKeyCount(liveKeys.size()); byte[] bcsId = metadata.getStore().get(DFSUtil.string2Bytes( OzoneConsts.BLOCK_COMMIT_SEQUENCE_ID_PREFIX)); - Preconditions.checkNotNull(bcsId); - kvContainerData.updateBlockCommitSequenceId(Longs.fromByteArray(bcsId)); + if (bcsId != null) { + kvContainerData.updateBlockCommitSequenceId(Longs.fromByteArray(bcsId)); + } } }