Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request incorrect shutdown type when fast reboot #4006

Open
dawnbeauty opened this issue Jan 10, 2020 · 0 comments · May be fixed by sonic-net/sonic-utilities#780 or #4008
Open

Request incorrect shutdown type when fast reboot #4006

dawnbeauty opened this issue Jan 10, 2020 · 0 comments · May be fixed by sonic-net/sonic-utilities#780 or #4008

Comments

@dawnbeauty
Copy link

Description
When fast reboot, we should request syncd FAST shutdown to keep data plane running.

syncd.cpp:

if (shutdownType == SYNCD_RESTART_TYPE_FAST || shutdownType == SYNCD_RESTART_TYPE_WARM)
    {
        SWSS_LOG_NOTICE("Fast/warm reboot requested, keeping data plane running");

        sai_attribute_t attr;

        attr.id = SAI_SWITCH_ATTR_UNINIT_DATA_PLANE_ON_REMOVAL;
        attr.value.booldata = false;

        status = sai_switch_api->set_switch_attribute(gSwitchId, &attr);

        if (status != SAI_STATUS_SUCCESS)
        {
            SWSS_LOG_ERROR("Failed to set SAI_SWITCH_ATTR_UNINIT_DATA_PLANE_ON_REMOVAL=false: %s",
                    sai_serialize_status(status).c_str());
        }
    }

But, in sonic-buildimage/files/scripts/syncd.sh, there are warm and cold shutdown types, seems like it missing the FAST.

    if [[ x"$WARM_BOOT" == x"true" ]]; then
        TYPE=warm
    else
        TYPE=cold
    fi

    if [[ x$sonic_asic_platform == x"mellanox" ]] && [[ x$TYPE == x"cold" ]]; then
        debug "Stopping pmon service ahead of syncd..."
        /bin/systemctl stop pmon
        debug "Stopped pmon service"
    fi

    if [[ x$sonic_asic_platform != x"mellanox" ]] || [[ x$TYPE != x"cold" ]]; then
        debug "${TYPE} shutdown syncd process ..."
        /usr/bin/docker exec -i syncd /usr/bin/syncd_request_shutdown --${TYPE}

Steps to reproduce the issue:

  1. fast-reboot

Describe the results you received:
request syncd cold shutdown

Describe the results you expected:
request syncd fast shutdown

dawnbeauty added a commit to dawnbeauty/sonic-utilities that referenced this issue Jan 10, 2020
Fixes sonic-net/sonic-buildimage#4006

1. save fast-reboot state into the db(aligned with sonic-net/sonic-buildimage#3741)
2. `sonic-buildimage/files/scripts/syncd.sh` could detect the FAST reboot type by the saved fast-reboot state, and request syncd to fast shutdown.
dawnbeauty added a commit to dawnbeauty/sonic-buildimage that referenced this issue Jan 10, 2020
@dawnbeauty dawnbeauty linked a pull request Jan 10, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant