def msg_updatereply(self, conn, msg):
        """merge decisions received with local decisions"""
        # If the node is already up-to-date, return.
        if self.stateuptodate:
            return
        for key,value in self.decisions.iteritems():
            if key in msg.decisions:
                assert self.decisions[key] == msg.decisions[key], "Update Error"
        # update decisions cumulatively
        self.decisions.update(msg.decisions)
        self.decisionset = set(self.decisions.values())
        self.usedcommandnumbers = self.usedcommandnumbers.union(set(self.decisions.keys()))
        # Execute the ones that we can execute
        while self.nexttoexecute in self.decisions:
            requestedcommand = self.decisions[self.nexttoexecute]
            if requestedcommand in self.executed:
                if self.debug: self.logger.write("State",
                                                 "Previously executed command %d."
                                                 % self.nexttoexecute)
                # Execute the metacommand associated with this command
                if self.nexttoexecute > WINDOW:
                    if self.debug: self.logger.write("State",
                                                     "performcore %d"
                                                     % (self.nexttoexecute-WINDOW))
                    self.performcore(self.decisions[self.nexttoexecute-WINDOW], True)
                self.nexttoexecute += 1
            elif requestedcommand not in self.executed:
                if self.debug: self.logger.write("State", "executing command %d." % self.nexttoexecute)

                if self.nexttoexecute > WINDOW:
                    if self.debug: self.logger.write("State", "performcore %d" % \
                                                         (self.nexttoexecute-WINDOW))
                    self.performcore(self.decisions[self.nexttoexecute-WINDOW], True)
                if self.debug: self.logger.write("State", "performcore %d" % self.nexttoexecute)
                self.performcore(self.decisions[self.nexttoexecute])
                self.nexttoexecute += 1
        # the window got bumped
        # check if there are pending commands, and issue one of them
        self.issue_pending_commands()
        if self.debug: self.logger.write("State", "Update is done!")
        self.stateuptodate = True
dataset/ETHPy150Open denizalti/concoord/concoord/replica.py/Replica.msg_updatereply/original