sonic-buildimage/files
Vaibhav Hemant Dixit 6e705dddb0 Fix for fast/cold-boot: call db_migrator only after old config is loaded (#14933)
Why I did it
Fix the issue where db_migrator is called before DB is loaded w/ config. This leads to db_migrator:

Not finding anything, and resumes to incorrectly migrate every missing config
This is not expected. migration should happen after the old config is loaded and only new schema changes need migration.
Since DB does not have anything when migrator is called, db_migrator fails when some APIs return None.
The reason for incorrect call is that:

database service starts db_migrator as part of startup sequence.
config-setup service loads data from old-config/minigraph. However, since it has Requires=database.service.
Hence, config-setup starts only when database service is started. And database service is started when db_migrator is completed.
Fixed by:

Check if this is first time boot by checking pending_config_migration flag.
If pending_config_migration is enabled, then do not call db_migrator as part of database service startup.
Let database service start which triggers config-setup service to start.
Now call db_migrator after when config-setup service loads old-config/minigraph
2023-06-02 18:25:16 +00:00
..
Aboot [Arista] Disable SSD NCQ on Lodoga (#13964) 2023-04-27 12:33:38 +08:00
apt [Build][202012] Support Debian snapshot mirror to improve build stability (#14558) 2023-04-20 22:45:33 -07:00
build/versions [ci/build]: Upgrade SONiC package versions 2023-05-10 20:50:40 +08:00
build_scripts [hostcfgd]: Add Ability To Configure Feature During Run-time (#6700) 2021-03-15 19:09:31 -07:00
build_templates Fix for fast/cold-boot: call db_migrator only after old config is loaded (#14933) 2023-06-02 18:25:16 +00:00
dhcp ZTP infrastructure changes to support DHCP discovery provisioning data (#3298) 2019-12-10 08:16:56 -08:00
docker Enabling ipv6 support on docker container network. This is needed (#5418) 2020-09-22 08:32:17 -07:00
image_config Fix for fast/cold-boot: call db_migrator only after old config is loaded (#14933) 2023-06-02 18:25:16 +00:00
initramfs-tools [Arista] Fix arista-net initramfs hook (#10626) 2022-04-20 10:03:37 -07:00
scripts Resolve neighbors from config_db (#14990) 2023-05-17 16:13:54 -07:00
sshd Remove SSH host keys after installing the custom version of sshd (#10633) (#11140) 2022-06-16 11:47:04 -07:00