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

Duplicated dbid in redis multi-instances causes error #5351

Open
BrynXu opened this issue Sep 9, 2020 · 4 comments
Open

Duplicated dbid in redis multi-instances causes error #5351

BrynXu opened this issue Sep 9, 2020 · 4 comments
Assignees

Comments

@BrynXu
Copy link
Contributor

BrynXu commented Sep 9, 2020

Description
Ideally dbid in different redis instances can be duplicated, but due to following code:

const TableNameSeparatorMap TableBase::tableNameSeparatorMap = {
   { APPL_DB,             TABLE_NAME_SEPARATOR_COLON },
   { ASIC_DB,             TABLE_NAME_SEPARATOR_COLON },
   { COUNTERS_DB,         TABLE_NAME_SEPARATOR_COLON },
   { LOGLEVEL_DB,         TABLE_NAME_SEPARATOR_COLON },
   { CONFIG_DB,           TABLE_NAME_SEPARATOR_VBAR  },
   { PFC_WD_DB,           TABLE_NAME_SEPARATOR_COLON },
   { FLEX_COUNTER_DB,     TABLE_NAME_SEPARATOR_COLON },
   { STATE_DB,            TABLE_NAME_SEPARATOR_VBAR  },
   { GB_ASIC_DB,          TABLE_NAME_SEPARATOR_VBAR  },
   { GB_COUNTERS_DB,      TABLE_NAME_SEPARATOR_VBAR  },
   { GB_FLEX_COUNTER_DB,  TABLE_NAME_SEPARATOR_VBAR  },
   { GLOBAL_APP_DB,       TABLE_NAME_SEPARATOR_VBAR  }
};

dup dbid in different instances will cause problem.

Steps to reproduce the issue:
1.
2.
3.

Describe the results you received:

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

**Output of `show version`:**

```
(paste your output here)
```

**Attach debug file `sudo generate_dump`:**

```
(paste your output here)
```
@qiluo-msft
Copy link
Collaborator

The tableNameSeparatorMap and the constructor TableBase(int dbId, const std::string &tableName) is going to deprecate in future, so it is suggested not to extend the map. Instead the same functionality could be achieved by database_config.json. Could you check?

@dzhangalibaba
Copy link
Collaborator

we need the dbid unique to go ahead with current multidb warmboot design.

@dzhangalibaba
Copy link
Collaborator

dzhangalibaba commented Sep 16, 2020

Any case we must use duplicated dbids?

@BrynXu
Copy link
Contributor Author

BrynXu commented Sep 16, 2020

not really a case, we found we have to use unique dbid for new db in new redis instance and assign it unique id, @lguohan raised a concern why the dbid is unique for the db in different redis instance.
Per my understand, dbids from different redis instances are not relevant, redis allows duplication among them, it is current sonic code introduces the unique id requirement, it is better to indicate this in doc for redis multi-instance developers.

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

No branches or pull requests

3 participants