Skip to content

Commit

Permalink
[systemlag] Lag id boundary set for system lag
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vedganes committed Mar 12, 2021
1 parent 35dd885 commit 58bbfce
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ function preStartAction()
updateSyslogConf
}

{%- if docker_container_name == "database" %}

function setPlatformLagIdBoundaries()
{
CHASSIS_CONF=/usr/share/sonic/device/$PLATFORM/chassisdb.conf
if [ -f "$CHASSIS_CONF" ]; then
source $CHASSIS_CONF
$SONIC_DB_CLI CHASSIS_APP_DB SET "SYSTEM_LAG_ID_START" "$lag_id_start"
$SONIC_DB_CLI CHASSIS_APP_DB SET "SYSTEM_LAG_ID_END" "$lag_id_end"
fi
}
{%- endif %}

function postStartAction()
{
{%- if docker_container_name == "database" %}
Expand Down Expand Up @@ -162,6 +175,7 @@ function postStartAction()
($(docker exec -i ${DOCKERNAME} $SONIC_DB_CLI CHASSIS_APP_DB PING | grep -c True) -gt 0) ]]; do
sleep 1
done
setPlatformLagIdBoundaries
REDIS_SOCK="/var/run/redis-chassis/redis_chassis.sock"
fi
chgrp -f redis $REDIS_SOCK && chmod -f 0760 $REDIS_SOCK
Expand Down

0 comments on commit 58bbfce

Please sign in to comment.