Skip to content

Comments

[action] [PR:1041] Ignore nonexistent include in database_global.json#64

Merged
mssonicbld merged 1 commit intoAzure:202412from
mssonicbld:cherry/msft-202412/1041
Sep 10, 2025
Merged

[action] [PR:1041] Ignore nonexistent include in database_global.json#64
mssonicbld merged 1 commit intoAzure:202412from
mssonicbld:cherry/msft-202412/1041

Conversation

@mssonicbld
Copy link
Collaborator

why

SonicDBConfig::initializeGlobalConfig aborts parsing global config if it encounters an include of a database config that doesn't exist. The global config file includes all possible includes in the switch. However, not all includes are relevant to a client. For example, in smartswitch, dash-ha container only cares NPU databases and databases of the DPU managed by the container. The current behavior requires a dash-ha container mounting all the DPU database instances.

what this PR does

  1. Add ignore_nonexistent flag, with default value false, to function parseDatabaseConfig. If it is set to true, it will not throw error if the included database config file doesn't exist.
  2. initializeGlobalConfig sets ignore_nonexistent to true when calling parseDatabaseConfig. If inst_entry, db_entry and separator_entry are empty, it will ignore the key.

### why
SonicDBConfig::initializeGlobalConfig aborts parsing global config if it encounters an include of a database config that doesn't exist. The global config file includes all possible includes in the switch. However, not all includes are relevant to a client. For example, in smartswitch, dash-ha container only cares NPU databases and databases of the DPU managed by the container. The current behavior requires a dash-ha container mounting all the DPU database instances.

### what this PR does
1. Add ignore_nonexistent flag, with default value false, to function parseDatabaseConfig. If it is set to true, it will not throw error if the included database config file doesn't exist.
2. initializeGlobalConfig sets ignore_nonexistent to true when calling parseDatabaseConfig. If inst_entry, db_entry and separator_entry are empty, it will ignore the key.
@mssonicbld
Copy link
Collaborator Author

Original PR: sonic-net/sonic-swss-common#1041

@mssonicbld
Copy link
Collaborator Author

/azp run

@mssonicbld mssonicbld merged commit b4a3cc6 into Azure:202412 Sep 10, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant