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

Introduce mode for persistent-memory configuration #17696

Merged
merged 7 commits into from
Oct 14, 2020

Conversation

blazember
Copy link
Contributor

@blazember blazember commented Oct 7, 2020

Introduce config attribute for the operational mode of the persistent memory. Two modes supported: MOUNTED (FS DAX) and SYSTEM_MEMORY (KMEM DAX). With this setting, the user can define to use PMEM in the KMEM DAX mode. Additionally, an enabled toggle is added to persistent-memory, which makes it explicit when persisten memory is used. For legacy reasons, if the persistent-memory-directory that was introduced in 4.0 is set, enabled is set to true, so the users already using persistent memory don't need to change their configs. Otherwise, the persistent memory should be explicitly enabled by setting enabled to
true, since the default is false.

EE PR: https://github.com/hazelcast/hazelcast-enterprise/pull/3814

@@ -433,7 +433,7 @@
min-block-size="10"
page-size="20">
<hz:size unit="GIGABYTES" value="256"/>
<hz:persistent-memory>
<hz:persistent-memory enabled="false" mode="MOUNTED">
Copy link
Contributor

Choose a reason for hiding this comment

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

If enabled flag is set to false, why do we still have the directory element underneath?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to test parsing regardless of the value of enabled. Probably it would be better to set it to true instead since false is the default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept false instead, this way we have cases both for enabled and disabled persistent memory config.

throw new InvalidConfigurationException("Invalid 'mode' for 'persistent-memory': " + modeValue);
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

If enabledNode is false, shall we go through the directories?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think yes. We need to build a config object hierarchy matching the declarative config.

@@ -28,11 +28,18 @@
* Configuration class for persistent memory devices (e.g. Intel Optane).
*/
public class PersistentMemoryConfig {
private boolean enabled;
Copy link
Contributor

Choose a reason for hiding this comment

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

Javadoc would be useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

Introduce config attribute for the operational mode of the persistent
memory. Two modes supported: `MOUNTED (FS DAX)` and `SYSTEM_MEMORY (KMEM
DAX)`. With this setting, the user can define to use PMEM in the KMEM DAX
mode. Additionally, an `enabled` toggle is added to `persistent-memory`,
which makes it explicit when persisten memory is used. For legacy
reasons, if the `persistent-memory-directory` that was introduced in 4.0
is set, `enabled` is set to `true`, so the users already using
persistent memory don't need to change their configs. Otherwise, the
persistent memory should be explicitly enabled by setting `enabled` to
`true`, since the default is `false`.
@mmedenjak mmedenjak added the Source: Internal PR or issue was opened by an employee label Oct 12, 2020
Copy link
Contributor

@mmedenjak mmedenjak left a comment

Choose a reason for hiding this comment

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

You covered all config aspects perfectly :)

@hazelcast hazelcast deleted a comment Oct 14, 2020
@blazember blazember merged commit b2c6871 into hazelcast:master Oct 14, 2020
@blazember
Copy link
Contributor Author

Thanks for the review @mmedenjak @petrpleshachkov @sancar 👍

@blazember blazember deleted the 4.1/optane/kmem-dax-2 branch October 14, 2020 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants