Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-2354

Under certain circumstances master assigns the same ID to different slaves.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 0.20.1
    • None
    • master
    • None

    Description

      If two slaves are created one after the other in quick succession, sometimes the master assigns both slaves the same ID. Example of this is the following test (use in master_tests.cpp):

      TEST_F(MasterTest, SlavesWithTheSameID)
      {
        // Start up the master.
        Try<PID<Master>> master = StartMaster();
        ASSERT_SOME(master);
      
        // Start a couple of slaves. Their only use is for them to register
        // to the master.
        Future<SlaveRegisteredMessage> slave1RegisteredMessage =
          FUTURE_PROTOBUF(SlaveRegisteredMessage(), master.get(), _);
        StartSlave();
        AWAIT_READY(slave1RegisteredMessage);
      
        Future<SlaveRegisteredMessage> slave2RegisteredMessage =
          FUTURE_PROTOBUF(SlaveRegisteredMessage(), master.get(), _);
        StartSlave();
        AWAIT_READY(slave2RegisteredMessage);
      
        ASSERT_FALSE(
            slave1RegisteredMessage.get().slave_id() ==
              slave2RegisteredMessage.get().slave_id());
      
        Shutdown();
      }
      

      The test needs to be ran multiple times for it to at some point fail. ie.

      ./bin/mesos-tests.sh --gtest_filter="MasterTest.SlavesWithTheSameID" --gtest_repeat=1000 --gtest_break_on_failure

      At some point, the output will be:

      ../../src/tests/master_tests.cpp:1618: Failure
      Value of: slave1RegisteredMessage.get().slave_id() == slave2RegisteredMessage.get().slave_id()
        Actual: true
      Expected: false
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              arojas Alexander Rojas
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: