Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-10027. NPE in VolumeInfoMetrics.getCommitted() #5885

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class HddsVolume extends StorageVolume {
private final VolumeIOStats volumeIOStats;
private final VolumeInfoMetrics volumeInfoMetrics;

private final AtomicLong committedBytes; // till Open containers become full
private final AtomicLong committedBytes = new AtomicLong(); // till Open containers become full

// Mentions the type of volume
private final VolumeType type = VolumeType.DATA_VOLUME;
Expand Down Expand Up @@ -121,7 +121,6 @@ private HddsVolume(Builder b) throws IOException {
this.getStorageDir().toString());
this.volumeInfoMetrics =
new VolumeInfoMetrics(b.getVolumeRootStr(), this);
this.committedBytes = new AtomicLong(0);

LOG.info("Creating HddsVolume: {} of storage type : {} capacity : {}",
getStorageDir(), b.getStorageType(),
Expand All @@ -134,7 +133,6 @@ private HddsVolume(Builder b) throws IOException {
this.setState(VolumeState.FAILED);
volumeIOStats = null;
volumeInfoMetrics = new VolumeInfoMetrics(b.getVolumeRootStr(), this);
committedBytes = null;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ public void testFailedVolumeSpace() throws IOException {
assertEquals(0, volumeInfoMetrics.getCapacity());
assertEquals(0, volumeInfoMetrics.getReserved());
assertEquals(0, volumeInfoMetrics.getTotalCapacity());
assertEquals(0, volumeInfoMetrics.getCommitted());
} finally {
// Shutdown the volume.
volume.shutdown();
Expand Down