Skip to content

HDDS-6808. EC: Fix datanode exclusion check in client - #3460

Merged
umamaheswararao merged 5 commits into
apache:masterfrom
kaijchen:HDDS-6808
Jun 1, 2022
Merged

HDDS-6808. EC: Fix datanode exclusion check in client#3460
umamaheswararao merged 5 commits into
apache:masterfrom
kaijchen:HDDS-6808

Conversation

@kaijchen

@kaijchen kaijchen commented May 26, 2022

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

We should call HddsClientUtils.checkForException before calling checkIfContainerToExclude.

This bug was introduced in HDDS-6400 (#3372).

What is the link to the Apache JIRA

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

How was this patch tested?

@kaijchen

Copy link
Copy Markdown
Member Author

@guihecheng PTAL.

@umamaheswararao

Copy link
Copy Markdown
Contributor

How did this issue triggered in your case? I am wondering if there is a chance to add some coverage

@kaijchen

Copy link
Copy Markdown
Member Author

How did this issue triggered in your case? I am wondering if there is a chance to add some coverage

I found it by writing some very large key (40 GB) in a real cluster, and to many datanodes are excluded at some point.

ozone freon ockg -n 100 --type EC --replication rs-10-4-1024k --size 4000000000

Maybe we can mock DN to return ContainerNotOpenException to test this?
The change here is "If caused by container not open, don't exclude datanode".

@umamaheswararao

Copy link
Copy Markdown
Contributor

Got it, thats a good idea. We have mock datanode ( MockDatanodeStorage). We used it for failure testing. Ex: see TestOzoneECClient#testNodeFailuresWhileWriting

@kaijchen

Copy link
Copy Markdown
Member Author

Hi @umamaheswararao, I have added the test to detect this problem.
There is still some undeterministic code because the pipeline chosen for write is unpredictable.
Do you have any better idea to improve it?

@umamaheswararao

Copy link
Copy Markdown
Contributor

Anyway we are marking nodes failed after key create and and getting the nodes which are part of pipeline. MultiNodePipelineBlockAllocator#allocateBlock is more predictable node selection. So, we will choose first required nodes for first allocate block and then next remaining nodes in order for next allocateBlock. So, by default we initialize this class with 15 nodes in cluster. So, if we just create one key with one block in it, it should always choose first required nodes.

Probably you can create your own client like this test doing, so that other tests would not have used that nodes.
Ex:

public void testStripeWriteRetriesOnFailures(OzoneConfiguration con,
      int clusterSize, int[] nodesIndexesToMarkFailure) throws IOException {
    close();
    MultiNodePipelineBlockAllocator blkAllocator =
        new MultiNodePipelineBlockAllocator(con, dataBlocks + parityBlocks,
            clusterSize);
    createNewClient(con, blkAllocator);

Assert.assertTrue(out.getOutputStream() instanceof ECKeyOutputStream);
ECKeyOutputStream ecKeyOut = (ECKeyOutputStream) out.getOutputStream();

List<HddsProtos.DatanodeDetailsProto> dns = allocator.getClusterDns();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test using default initialized Allocator. One we marked some nodes failed, they may be reflected to other tests.
It would be good to have own allocator and client created for the failure related tests, so that state would not interfere with others.

@kaijchen

kaijchen commented Jun 1, 2022

Copy link
Copy Markdown
Member Author

@umamaheswararao Thanks for the advice, I have tested each of these 100x and it seems stable.

@umamaheswararao

Copy link
Copy Markdown
Contributor

Thanks for verifying.
Latest changes LGTM.

@umamaheswararao umamaheswararao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pending CI.

@umamaheswararao
umamaheswararao merged commit af3a80d into apache:master Jun 1, 2022
@kaijchen

kaijchen commented Jun 1, 2022

Copy link
Copy Markdown
Member Author

Thanks @umamaheswararao for the review.

@kaijchen
kaijchen deleted the HDDS-6808 branch June 1, 2022 06:14
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.

2 participants