-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[MultiDB] add mutidb warmboot support - restoring database #5773
Conversation
@qiluo-msft These two PRs are for multiDB warmboot support as proposed earlier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As comments
* lua script to backup all database into one database and create rdb file - following earlier multiDB warmboot design at https://github.com/Azure/SONiC/blob/master/doc/database/multi_database_instances.md * copy this rdb file as before to WARM_DIR * restoring database part is in another PR at sonic-buildimage sonic-net/sonic-buildimage#5773, they depend on each other
@qiluo-msft I saw another pr is merged sonic-net/sonic-utilities#1205 We need this PR ready as well if we want to update sonic-utilities sub module, otherwise warm boot will be broken. Please take a look on this as well |
Offline discussed. |
3fda8bd
to
376bd15
Compare
376bd15
to
4302c61
Compare
mkdir -p /var/lib/$inst | ||
if [[ -f $DUMPFILE ]]; then | ||
# copy warmboot rdb file into each new instance location | ||
cp $DUMPFILE /var/lib/$inst/dump.rdb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If cp
source file is same as the destination, there will be error message and exit code. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it on DUT earlier, it just shows a msg telling A and B are the same file, it didn't affect the function, also we don't use the exit code in docker-database-init.sh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree. Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I revisit the behavior, to not change today’s behavior, cp -u is correct instead of -n. There is a case we need to overwrite. For example, after warm boot, we do a cold boot, an empty rdb file wil overwrite the previous warm boot rdb file. So -u is correct, only newer source will be copied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the insight and sorry for the misleading. Even cp -u
is not exactly what you truly need, considering the extreme the case the time adjusted backward. So either option is ok:
- revert back to bare
cp
, and keep error messages - check $DUMPFILE != /var/lib/$inst/dump.rdb before
cp
In reply to: 536868596 [](ancestors = 536868596,536449280)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am checking if src and dst file is the same. Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more comment
@qiluo-msft looks everything passed. Could we merg this and at the same time , I'll open another for updating sonic-utilities |
…acking up database (#6181) update sonic-utilites submodule, adding MultiDB warmboot backing up database support: * [MultiDB] add MultiDB warmboot support - backing up database (#1205) * lua script to backup all database into one database and create rdb file - following earlier multiDB warmboot design at https://github.com/Azure/SONiC/blob/master/doc/database/multi_database_instances.md * copy this rdb file as before to WARM_DIR * restoring database part is in another PR at sonic-buildimage #5773, they depend on each other
* lua script to backup all database into one database and create rdb file - following earlier multiDB warmboot design at https://github.com/Azure/SONiC/blob/master/doc/database/multi_database_instances.md * copy this rdb file as before to WARM_DIR * restoring database part is in another PR at sonic-buildimage sonic-net/sonic-buildimage#5773, they depend on each other
Signed-off-by: Dong Zhang d.zhang@alibaba-inc.com