sonic-buildimage/files/build_templates
Vaibhav Hemant Dixit 02b17839c3
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-05-30 10:16:21 -07:00
..
per_namespace [config reload]Config Reload Enhancement (#13969) 2023-04-12 11:20:03 -07:00
share_image [hostcfgd] Configure service auto-restart in hostcfgd. (#5744) 2021-06-29 09:06:21 -07:00
arp_update_vars.j2 chassis-packet: resolve the missing static routes (#14593) 2023-04-12 15:07:42 +08:00
backend_acl.j2 Add backend acl template (#11220) 2022-07-06 10:24:16 -07:00
buffers_config.j2 Update PG headroom settings ports based on port speed/cable length (#14908) 2023-05-19 08:19:27 -07:00
build_docker_cache.j2 02.Version cache - docker cache build framework (#12001) 2022-12-02 08:28:45 +08:00
cbf_config.j2 [CBF] Added configuration templates to generate configs for CBF (#8689) 2021-10-29 17:18:57 -07:00
config-chassisdb.service.j2 [ChassisDB]: bring up ChassisDB service (#5283) 2020-10-14 15:15:24 -07:00
config-setup.service.j2 Add support for platform topology configuration service (#12066) 2023-02-01 12:53:45 -08:00
database.service.j2 Multi-ASIC implementation (#3888) 2020-03-31 10:06:19 -07:00
dhcp_relay.service.j2 [hostcfgd] Configure service auto-restart in hostcfgd. (#5744) 2021-06-29 09:06:21 -07:00
docker_image_ctl.j2 Fix for fast/cold-boot: call db_migrator only after old config is loaded (#14933) 2023-05-30 10:16:21 -07:00
dockerd_regex.json Add Structured Events w/ YANG Models (#12270) 2022-10-09 20:23:31 -07:00
eventd.service.j2 Streaming structured events implementation (#11848) 2022-09-03 07:33:25 -07:00
events_info.json Add rsyslog plugin regex for select operation failure (#12659) 2022-11-13 21:41:33 -08:00
iccpd.service.j2 [services] introduce sonic.target (#5705) 2021-02-25 14:26:24 +02:00
init_cfg.json.j2 [config reload]Config Reload Enhancement (#13969) 2023-04-12 11:20:03 -07:00
kernel_regex.json Add Structured Events w/ YANG Models (#12270) 2022-10-09 20:23:31 -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 [Fastboot] Delay LLDP service for better fastboot performance (#10568) 2022-04-28 10:35:14 +03:00
manifest.json.j2 [infra] Support syslog rate limit configuration (#12490) 2022-12-20 10:53:58 +02:00
mgmt-framework.service.j2 [services] kill container on stop in warm/fast mode (#10510) 2022-09-19 19:34:33 +03:00
monit_regex.json Add fix to monit_regex.json for catching mem_usage and cpu_usage (#14954) 2023-05-08 11:48:17 -07:00
mux.service.j2 Delay mux/sflow/snmp timer after interface-config service (#14506) 2023-04-04 16:23:00 -07:00
nat.service.j2 [hostcfgd] Configure service auto-restart in hostcfgd. (#5744) 2021-06-29 09:06:21 -07:00
organization_extensions.sh Framework to plugin Organization specific scripts during ONIE Image build (#951) 2017-09-19 16:23:31 -07:00
p4rt.service.j2 [PINS] Build P4RT container for PINS (#9083) 2021-12-07 11:11:25 -08:00
packages.json.j2 [sonic_debian_extension] fix packages.json generation and make the build fail when packages.json is not generated (#8044) 2021-07-09 12:29:33 -07:00
pde.service.j2 [PDE]: introduce the SONiC Platform Development Env (#7510) 2021-07-24 16:24:43 -07:00
pmon.service.j2 [Fastboot] Delay PMON service for better fastboot performance (#10567) 2022-05-02 10:44:17 +03:00
qos_config.j2 Apply separated DSCP_TO_TC_MAP and TC_TO_QUEUE_MAP to uplink ports on dualtor (#12730) 2022-11-21 11:42:28 -08:00
radv.service.j2 [hostcfgd] Configure service auto-restart in hostcfgd. (#5744) 2021-06-29 09:06:21 -07:00
restapi.service.j2 [hostcfgd] Configure service auto-restart in hostcfgd. (#5744) 2021-06-29 09:06:21 -07:00
rsyslog_plugin.conf.j2 Add events to host and create rsyslog_plugin deb pkg (#12059) 2022-09-21 09:20:53 -07:00
seu_regex.json Add Structured Events w/ YANG Models (#12270) 2022-10-09 20:23:31 -07:00
sflow.service.j2 Delay mux/sflow/snmp timer after interface-config service (#14506) 2023-04-04 16:23:00 -07:00
snmp.service.j2 [config reload]Config Reload Enhancement (#13969) 2023-04-12 11:20:03 -07:00
sonic_debian_extension.j2 [image_config] add rasdaemon.timer (#14300) 2023-04-17 08:58:45 -07:00
sonic_version.yml.j2 Support to add SONiC OS Version in device info (#14601) 2023-04-12 09:20:08 +08:00
sonic.target [services] introduce sonic.target (#5705) 2021-02-25 14:26:24 +02:00
sshd_regex.json Add events to host and create rsyslog_plugin deb pkg (#12059) 2022-09-21 09:20:53 -07:00
swss_vars.j2 [Mellanox] Support DSCP remapping in dual ToR topo on T0 switch (#12605) 2023-02-07 16:21:59 +02:00
syncd_regex.json Add rsyslog plugin regex for select operation failure (#12659) 2022-11-13 21:41:33 -08:00
systemd_regex.json Add Structured Events w/ YANG Models (#12270) 2022-10-09 20:23:31 -07:00
tacacs-config.service Add service to restore TACACS from old config (#7560) 2021-06-03 20:07:17 -07:00
tacacs-config.timer [services] Update "WantedBy=" section for tacacs-config.timer. (#11893) 2022-09-08 15:16:11 -07:00
telemetry.service.j2 [services] kill container on stop in warm/fast mode (#10510) 2022-09-19 19:34:33 +03:00
updategraph.service.j2 [config-setup]: create a SONiC configuration management service (#3227) 2019-12-04 07:15:58 -08:00