sonic-buildimage/files/build_templates
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
..
per_namespace [mux] skip mux operations during warm shutdown (#11937) 2022-10-03 22:30:55 +00:00
share_image [ChassisDB]: bring up ChassisDB service (#5283) 2020-10-14 15:15:24 -07:00
arp_update_vars.j2 [swss][arp_update] Send ipv6 pings over vlan sub interfaces (#8363) 2021-08-07 12:43:51 +00:00
backend_acl.j2 Add backend acl template (#11220) 2022-07-08 21:39:39 +00:00
buffers_config.j2 [202012][Buffer] Added cable length config to buffer config template for EdgeZoneAggregator (#14539) 2023-04-10 11:58:34 -07:00
config-chassisdb.service.j2 [ChassisDB]: bring up ChassisDB service (#5283) 2020-10-14 15:15:24 -07:00
config-setup.service.j2 [config-setup]: create a SONiC configuration management service (#3227) 2019-12-04 07:15:58 -08:00
database.service.j2 Multi-ASIC implementation (#3888) 2020-03-31 10:06:19 -07:00
dhcp_relay.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
docker_image_ctl.j2 Fix for fast/cold-boot: call db_migrator only after old config is loaded (#14933) 2023-06-02 18:25:16 +00:00
gbsyncd.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
iccpd.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
init_cfg.json.j2 [202012] [Fastboot] Delay PMON service for better fastboot performance (#10745) 2022-05-15 23:31:32 -07:00
kube_cni.10-flannel.conflist First cut image update for kubernetes support. (#5421) 2020-12-22 08:01:33 -08:00
lldp.service.j2 Changes for LLDP docker to support multi-npu platforms (#4530) 2020-05-11 11:05:44 -07:00
lldp.timer.j2 [202012] [Fastboot] Delay LLDP service for better fastboot performance (#10568) (#10744) 2022-05-15 15:05:29 +03:00
mgmt-framework.service.j2 [services] kill container on stop in warm/fast mode (#10511) 2022-04-18 14:27:48 -07:00
mgmt-framework.timer Grouping delayed services under a target for config reload checks (#7846) 2021-08-16 07:50:56 +00:00
mux.service.j2 [mux] Exit to write standby state to active-active ports (#11821) 2022-10-03 19:52:51 +00:00
nat.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
organization_extensions.sh Framework to plugin Organization specific scripts during ONIE Image build (#951) 2017-09-19 16:23:31 -07:00
pmon.service.j2 [202012] [Fastboot] Delay PMON service for better fastboot performance (#10745) 2022-05-15 23:31:32 -07:00
pmon.timer [202012] [Fastboot] Delay PMON service for better fastboot performance (#10745) 2022-05-15 23:31:32 -07:00
qos_config.j2 [202012] Apply separated DSCP_TO_TC_MAP and TC_TO_QUEUE_MAP on dualtor (#12792) 2022-11-23 21:49:00 +08:00
radv.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
restapi.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
sflow.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
snmp.service.j2 [services] kill container on stop in warm/fast mode (#10511) 2022-04-18 14:27:48 -07:00
snmp.timer Grouping delayed services under a target for config reload checks (#7846) 2021-08-16 07:50:56 +00:00
sonic_debian_extension.j2 [Build] Upgrade the python docker version (#15031) 2023-05-12 11:37:00 -07:00
sonic-delayed.target Grouping delayed services under a target for config reload checks (#7846) 2021-08-16 07:50:56 +00:00
sonic.target [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
swss_vars.j2 [swss_vars]: Add 'resource_type' attribute. (#7188) 2021-05-03 10:38:11 -07:00
tacacs-config.service Add service to restore TACACS from old config (#7560) 2021-06-07 06:02:32 +00:00
tacacs-config.timer Add service to restore TACACS from old config (#7560) 2021-06-07 06:02:32 +00:00
telemetry.service.j2 [services] kill container on stop in warm/fast mode (#10511) 2022-04-18 14:27:48 -07:00
telemetry.timer Grouping delayed services under a target for config reload checks (#7846) 2021-08-16 07:50:56 +00:00
updategraph.service.j2 [config-setup]: create a SONiC configuration management service (#3227) 2019-12-04 07:15:58 -08:00