Skip to content

Update the DBmigrator to support persistent loglevel during warm-upgrade#2370

Merged
liat-grozovik merged 12 commits intosonic-net:masterfrom
EdenGri:persistent_loglevel
Oct 25, 2022
Merged

Update the DBmigrator to support persistent loglevel during warm-upgrade#2370
liat-grozovik merged 12 commits intosonic-net:masterfrom
EdenGri:persistent_loglevel

Conversation

@EdenGri
Copy link
Copy Markdown
Contributor

@EdenGri EdenGri commented Sep 14, 2022

This PR needs to be merged only after the following PR: sonic-net/sonic-buildimage#11996

What I did

Add the ability to the user to save the loglevel and make it persistent to reboot with the support in warm-upgrade. (Not need to add special support for cold/fast reboot since the LOGLEVEL DB flushes during fast/cold reboot).

How I did it

Add a new version to the db_migrator that will move the logger tables from the LOGLEVEL DB to the CONFIG DB

How to verify it

  1. start with a switch that has an old master image (old master means that the VERSION in the config db is 3_0_5 or lower)
  2. install this image to the switch
  3. run warm-reboot
  4. verify that the LOGLEVEL DB does not contain logger tables -> run redis-cli -n 3 keys "*" (expect to see only the JINJA2CACHE)
  5. verify that the logger tables are in the config db -> run redis-cli -n 4 keys "LOGGER|*"

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@dprital dprital marked this pull request as draft September 14, 2022 10:29
@EdenGri
Copy link
Copy Markdown
Contributor Author

EdenGri commented Sep 14, 2022

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@dprital dprital marked this pull request as ready for review September 19, 2022 11:18
@dprital dprital requested a review from qiluo-msft September 20, 2022 15:49
@qiluo-msft qiluo-msft requested a review from yxieca September 20, 2022 21:55
@qiluo-msft
Copy link
Copy Markdown
Contributor

Could you refine the PR title?

yxieca
yxieca previously approved these changes Sep 28, 2022
@EdenGri EdenGri changed the title Persistent loglevel Update the DBmigrator to support persistent loglevel during warm-upgrade Oct 2, 2022
@EdenGri
Copy link
Copy Markdown
Contributor Author

EdenGri commented Oct 2, 2022

Done, thanks @qiluo-msft

@EdenGri
Copy link
Copy Markdown
Contributor Author

EdenGri commented Oct 6, 2022

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

qiluo-msft
qiluo-msft previously approved these changes Oct 6, 2022
Comment thread tests/db_migrator_input/config_db/reclaiming-buffer-warmreboot-expected.json Outdated
@EdenGri EdenGri dismissed stale reviews from qiluo-msft and yxieca via 3843adf October 12, 2022 15:56
@EdenGri EdenGri force-pushed the persistent_loglevel branch from 803167a to 1563769 Compare October 12, 2022 16:07
@EdenGri EdenGri requested review from qiluo-msft and yxieca and removed request for qiluo-msft and yxieca October 13, 2022 13:45
@EdenGri EdenGri requested review from qiluo-msft and removed request for yxieca October 19, 2022 06:46
@qiluo-msft qiluo-msft requested a review from vaibhavhd October 19, 2022 20:20
@EdenGri EdenGri requested review from yxieca and removed request for vaibhavhd October 20, 2022 07:05
@dprital dprital requested a review from vaibhavhd October 23, 2022 07:52
@qiluo-msft
Copy link
Copy Markdown
Contributor

bandit checker is not 'Required', so please go ahead and merge it.

},
"VERSIONS|DATABASE": {
"VERSION": "version_3_0_5"
"VERSION": "version_3_0_3"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this change needed? Is this relevant to persistance loglevel design?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, relevant to persistance loglevel design.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see. I am unable to understand, can you explain why tests for reclaiming-buffer need to be changed for persistence log-level design?

Copy link
Copy Markdown
Collaborator

@stephenxs stephenxs Oct 24, 2022

Choose a reason for hiding this comment

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

Hi @vaibhavhd
This is to change it back, correcting an error caused by an old PR. Refer this comment for details

@liat-grozovik liat-grozovik merged commit 7e7d05c into sonic-net:master Oct 25, 2022
dprital added a commit to dprital/sonic-buildimage that referenced this pull request Oct 28, 2022
Update sonic-utilities submodule pointer to include the following:
* 4a3d49d Fix exception in adding mirror_session when gre_type is absent ([sonic-net#2458](sonic-net/sonic-utilities#2458))
* 7e7d05c Update the DBmigrator to support persistent loglevel during warm-upgrade ([sonic-net#2370](sonic-net/sonic-utilities#2370))
* c2841b8 [doc]: Update Command-Reference.md ([sonic-net#2444](sonic-net/sonic-utilities#2444))
* 254cafc Event Counters CLI ([sonic-net#2449](sonic-net/sonic-utilities#2449))
* 2dab0d0 [techsupport] Adding FRR EVPN dumps ([sonic-net#2442](sonic-net/sonic-utilities#2442))
* 3c0aece [show][muxcable] add support for show mux firmware version all ([sonic-net#2441](sonic-net/sonic-utilities#2441))

Signed-off-by: dprital <drorp@nvidia.com>
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this pull request Nov 21, 2022
…ade (sonic-net#2370)

- What I did
Add the ability to the user to save the loglevel and make it persistent to reboot with the support in warm-upgrade. (Not need to add special support for cold/fast reboot since the LOGLEVEL DB flushes during fast/cold reboot).

- How I did it
Add a new version to the db_migrator that will move the logger tables from the LOGLEVEL DB to the CONFIG DB

- How to verify it
1. start with a switch that has an old master image (old master means that the VERSION in the config db is 3_0_5 or lower)
2. install this image to the switch
3. run warm-reboot
4. verify that the LOGLEVEL DB does not contain logger tables -> run redis-cli -n 3 keys "*" (expect to see only the JINJA2CACHE)
5. verify that the logger tables are in the config db -> run redis-cli -n 4 keys "LOGGER|*"
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.

7 participants