[MultiDB] add mutidb warmboot support - restoring database#5773
[MultiDB] add mutidb warmboot support - restoring database#5773qiluo-msft merged 7 commits intosonic-net:masterfrom
Conversation
|
@qiluo-msft These two PRs are for multiDB warmboot support as proposed earlier. |
* 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.
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.
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.
There was a problem hiding this comment.
agree. Updated
There was a problem hiding this comment.
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.
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.
I am checking if src and dst file is the same. Updated
|
@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 [email protected]