Skip to content

Comments

HDDS-4840. Make datanode db profile configurable with existing hdds.d…#1955

Merged
elek merged 3 commits intoapache:masterfrom
guihecheng:HDDS-4840
Apr 8, 2021
Merged

HDDS-4840. Make datanode db profile configurable with existing hdds.d…#1955
elek merged 3 commits intoapache:masterfrom
guihecheng:HDDS-4840

Conversation

@guihecheng
Copy link
Contributor

@guihecheng guihecheng commented Feb 23, 2021

…b.profile

What changes were proposed in this pull request?

Make datanode use the config item hdds.db.profile, instead of statically default to use spinning disk profile.

What is the link to the Apache JIRA

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

Please replace this section with the link to the Apache JIRA)

How was this patch tested?

UT:TestKeyValueContainer:testDBProfileAffectsDBOptions

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @guihecheng for working on this. Can you please add some unit tests, eg. in TestKeyValueContainer? (testContainersShareColumnFamilyOptions might be a good place to start.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: instead of passing dbProfile member variable, can you please make buildColumnFamilyOptions non-static?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, thanks for your advice, I'll fix it and try to add a simple test case~

@guihecheng
Copy link
Contributor Author

@adoroszlai updated for review, thanks~

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @guihecheng for updating the patch. Mostly looks good to me, but I think TEST profile is unnecessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should try to avoid introducing test-specific items in production code. Why not test with existing DISK and SSD profiles instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adoroszlai oh, it is simply because the ColumnFamilyOptions for DISK & SSD happen to be the same, as I tested, so a new profile TEST is introduced.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I've read this line that setting the compactionStyle to CompactionStyle.LEVEL, but actually it is just the default style, so the results are still the same.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point. How about checking non-equality of getDBOptions().compactionReadaheadSize() between the two profiles? Those are different.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adoroszlai well, I admit that there merely any difference to check the DBOptions or ColumnFamilyOptions, here I intended to check the ColumnFamilyOptions just because it is convenient to use the existing OPTIONS_CACHE in AbstractDatanodeStore.
So to check the DBOptions, I'll try to export the DBOptions as well(or the DBProfile directly), just for test, what do you think?

Copy link
Contributor

@adoroszlai adoroszlai Mar 2, 2021

Choose a reason for hiding this comment

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

@guihecheng Thanks for checking. I think providing an accessor for AbstractDatanodeStore's DBProfile for the test is much less intrusive than the fake profile.

@guihecheng guihecheng force-pushed the HDDS-4840 branch 2 times, most recently from 50bdfa9 to dd5c9ac Compare March 3, 2021 05:52
@guihecheng
Copy link
Contributor Author

@adoroszlai updated the utest case for review, now we get rid of the TEST profile.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @guihecheng for updating the patch.

@adoroszlai
Copy link
Contributor

@errose28 Would you like to review?

@adoroszlai adoroszlai requested a review from elek March 11, 2021 18:16
@errose28
Copy link
Contributor

Sure, thanks @adoroszlai and @guihecheng I will take a look.

Copy link
Contributor

@errose28 errose28 left a comment

Choose a reason for hiding this comment

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

Just a minor inline comment, otherwise LGTM. Thanks @guihecheng for working on this!

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think we can remove lines 238-239 RocksDB.loadLibrary since this method is no longer static.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nit: I think we can remove lines 238-239 RocksDB.loadLibrary since this method is no longer static.

oh, by reading the comment in the code, it seems to be reasonable to remove this line, but I'll check and test it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@errose28 It seems that you are right, the RocksDB.loadLibrary is not needed anymore as I testd, will update, thx~

@guihecheng
Copy link
Contributor Author

well, there's seem to be a unrelated case failure.

@mukul1987 mukul1987 force-pushed the master branch 2 times, most recently from 79a9d39 to 520ba00 Compare March 25, 2021 16:05
@elek
Copy link
Member

elek commented Apr 8, 2021

Merging it as we have green build. Thanks the review @adoroszlai and @errose28

@elek elek merged commit 9c92855 into apache:master Apr 8, 2021
@guihecheng guihecheng deleted the HDDS-4840 branch May 6, 2021 02:10
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.

4 participants