Skip to content

Commit b313d4d

Browse files
[systemlag] Lag id boundary set for system lag (#6488)
Signed-off-by: vedganes <vedavinayagam.ganesan@nokia.com> Changes for setting platfrom specific lag id boundary id in the chassis app db. The platfrom specific lag id boundaries are supplied via chassisdb.conf. The lag_id_start and lag_id_end boundary values sourced from this file are set in chassis app db which will be used by lag id allocator to allocate unique lag id in atomic fashion
1 parent ecaf97d commit b313d4d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

files/build_templates/docker_image_ctl.j2

+14
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,19 @@ function preStartAction()
101101
updateSyslogConf
102102
}
103103

104+
{%- if docker_container_name == "database" %}
105+
106+
function setPlatformLagIdBoundaries()
107+
{
108+
CHASSIS_CONF=/usr/share/sonic/device/$PLATFORM/chassisdb.conf
109+
if [ -f "$CHASSIS_CONF" ]; then
110+
source $CHASSIS_CONF
111+
$SONIC_DB_CLI CHASSIS_APP_DB SET "SYSTEM_LAG_ID_START" "$lag_id_start"
112+
$SONIC_DB_CLI CHASSIS_APP_DB SET "SYSTEM_LAG_ID_END" "$lag_id_end"
113+
fi
114+
}
115+
{%- endif %}
116+
104117
function postStartAction()
105118
{
106119
{%- if docker_container_name == "database" %}
@@ -162,6 +175,7 @@ function postStartAction()
162175
($(docker exec -i ${DOCKERNAME} $SONIC_DB_CLI CHASSIS_APP_DB PING | grep -c True) -gt 0) ]]; do
163176
sleep 1
164177
done
178+
setPlatformLagIdBoundaries
165179
REDIS_SOCK="/var/run/redis-chassis/redis_chassis.sock"
166180
fi
167181
chgrp -f redis $REDIS_SOCK && chmod -f 0760 $REDIS_SOCK

0 commit comments

Comments
 (0)