From e54977f888e1a855e9f88b9fa41e0c8794bd0881 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" <6454655+adoroszlai@users.noreply.github.com> Date: Tue, 17 Sep 2019 11:01:33 +0200 Subject: [PATCH] HDDS-2132. TestKeyValueContainer is failing (#1457). --- .../container/keyvalue/helpers/KeyValueContainerUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)); + } } }