Skip to content

Commit

Permalink
b/308835681 control: Support metadata outside of tmpfs
Browse files Browse the repository at this point in the history
The upstream 2.4 release has support for storing engine
metadata outside of tmpfs, but it is tied to the new
MD-on-SSD feature preview. With some small adjustments
to the code, we can enable external metadata without
MD-on-SSD.

Required-githooks: true

Change-Id: If3e728a2db7a4994572bbe53c92654f2e9b01ee0
Signed-off-by: Michael MacDonald <mjmac@google.com>
  • Loading branch information
mjmac authored and jolivier23 committed Dec 13, 2023
1 parent 507084e commit 5eacf48
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
9 changes: 5 additions & 4 deletions src/control/server/storage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ const (
// ControlMetadata describes configuration options for control plane metadata storage on the
// DAOS server.
type ControlMetadata struct {
Path string `yaml:"path,omitempty"`
DevicePath string `yaml:"device,omitempty"`
Path string `yaml:"path,omitempty"`
DevicePath string `yaml:"device,omitempty"`
DisableMdOnSSD bool `yaml:"disable_md_on_ssd,omitempty"`
}

// Directory returns the full path to the directory where the control plane metadata is saved.
Expand Down Expand Up @@ -1098,7 +1099,7 @@ func (c *Config) Validate() error {
// backend, set to empty when no devices specified
if len(bdevCfgs) == 0 {
c.ConfigOutputPath = ""
if c.ControlMetadata.HasPath() {
if c.ControlMetadata.HasPath() && !c.ControlMetadata.DisableMdOnSSD {
return FaultBdevConfigControlMetadataNoRoles
}

Expand All @@ -1115,7 +1116,7 @@ func (c *Config) Validate() error {

var nvmeConfigRoot string
if c.ControlMetadata.HasPath() {
if !c.Tiers.HasBdevRoleMeta() {
if !c.Tiers.HasBdevRoleMeta() && !c.ControlMetadata.DisableMdOnSSD {
return FaultBdevConfigControlMetadataNoRoles
}
nvmeConfigRoot = c.ControlMetadata.EngineDirectory(c.EngineIdx)
Expand Down
17 changes: 11 additions & 6 deletions src/engine/srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1300,12 +1300,17 @@ dss_sys_db_init()
char *sys_db_path = NULL;
char *nvme_conf_path = NULL;

if (!bio_nvme_configured(SMD_DEV_TYPE_META))
goto db_init;

if (dss_nvme_conf == NULL) {
D_ERROR("nvme conf path not set\n");
return -DER_INVAL;
/* must be set if md-on-ssd is enabled */
if (bio_nvme_configured(SMD_DEV_TYPE_META)) {
D_ERROR("nvme conf path not set\n");
return -DER_INVAL;
}
D_STRNDUP(sys_db_path, dss_storage_path, PATH_MAX);
if (sys_db_path == NULL)
return -DER_NOMEM;

goto db_init;
}

D_STRNDUP(nvme_conf_path, dss_nvme_conf, PATH_MAX);
Expand All @@ -1317,7 +1322,7 @@ dss_sys_db_init()
return -DER_NOMEM;

db_init:
rc = vos_db_init(bio_nvme_configured(SMD_DEV_TYPE_META) ? sys_db_path : dss_storage_path);
rc = vos_db_init(sys_db_path);
if (rc)
goto out;

Expand Down

0 comments on commit 5eacf48

Please sign in to comment.