Skip to content

HDDS-9896. Fix for NullPointerException when replicating closed container using freon#5765

Merged
jojochuang merged 2 commits intoapache:masterfrom
hemantk-12:HDDS-9896
Dec 12, 2023
Merged

HDDS-9896. Fix for NullPointerException when replicating closed container using freon#5765
jojochuang merged 2 commits intoapache:masterfrom
hemantk-12:HDDS-9896

Conversation

@hemantk-12
Copy link
Contributor

What changes were proposed in this pull request?

We are seeing NPE when replicating closed container using freon

java.lang.NullPointerException
 at org.apache.hadoop.ozone.container.replication.ContainerImporter.chooseNextVolume(ContainerImporter.java:146)
 at org.apache.hadoop.ozone.container.replication.DownloadAndImportReplicator.replicate(DownloadAndImportReplicator.java:77)
 at org.apache.hadoop.ozone.container.replication.ReplicationTask.runTask(ReplicationTask.java:122)
 at org.apache.hadoop.ozone.container.replication.ReplicationSupervisor$TaskRunner.run(ReplicationSupervisor.java:359)
 at org.apache.hadoop.ozone.freon.ClosedContainerReplicator.lambda$replicateContainer$1(ClosedContainerReplicator.java:224)
 at com.codahale.metrics.Timer.time(Timer.java:101)
 at org.apache.hadoop.ozone.freon.ClosedContainerReplicator.replicateContainer(ClosedContainerReplicator.java:221)
 at org.apache.hadoop.ozone.freon.BaseFreonGenerator.tryNextTask(BaseFreonGenerator.java:220)
 at org.apache.hadoop.ozone.freon.BaseFreonGenerator.taskLoop(BaseFreonGenerator.java:200)
 at org.apache.hadoop.ozone.freon.BaseFreonGenerator.lambda$startTaskRunners$0(BaseFreonGenerator.java:174)
 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
 at java.base/java.lang.Thread.run(Thread.java:834)

This change is to fix NPE and pass non-null volumeSet when creating ContainerImporter object to replicate closed container using freon. Also added @NotNull annotation on ContainerImporter's constructor for developers.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-9896

How was this patch tested?

Existing unit and integ tests for now.

@hemantk-12 hemantk-12 changed the title HDDS-9896. Fix for NullPointerException when replicating closed container using freon [HDDS-9896]. Fix for NullPointerException when replicating closed container using freon Dec 11, 2023
@hemantk-12 hemantk-12 changed the title [HDDS-9896]. Fix for NullPointerException when replicating closed container using freon HDDS-9896. Fix for NullPointerException when replicating closed container using freon Dec 11, 2023
@kerneltime kerneltime requested a review from sodonnel December 11, 2023 17:09
@kerneltime
Copy link
Contributor

cc @DaveTeng0

Copy link
Contributor

@jojochuang jojochuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
But maybe we should have robot tests for freon commands in the future.

@hemantk-12 hemantk-12 marked this pull request as ready for review December 11, 2023 19:10
@jojochuang jojochuang merged commit cdf3e16 into apache:master Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants