{"action":"created","issue":{"url":"https://api.github.com/repos/tencent-wechat/phxpaxos/issues/42","repository_url":"https://api.github.com/repos/tencent-wechat/phxpaxos","labels_url":"https://api.github.com/repos/tencent-wechat/phxpaxos/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/tencent-wechat/phxpaxos/issues/42/comments","events_url":"https://api.github.com/repos/tencent-wechat/phxpaxos/issues/42/events","html_url":"https://github.com/tencent-wechat/phxpaxos/issues/42","id":199427644,"number":42,"title":"重启时状态机恢复问题","user":{"login":"lmdyyh","id":4398247,"avatar_url":"https://avatars.githubusercontent.com/u/4398247?v=3","gravatar_id":"","url":"https://api.github.com/users/lmdyyh","html_url":"https://github.com/lmdyyh","followers_url":"https://api.github.com/users/lmdyyh/followers","following_url":"https://api.github.com/users/lmdyyh/following{/other_user}","gists_url":"https://api.github.com/users/lmdyyh/gists{/gist_id}","starred_url":"https://api.github.com/users/lmdyyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmdyyh/subscriptions","organizations_url":"https://api.github.com/users/lmdyyh/orgs","repos_url":"https://api.github.com/users/lmdyyh/repos","events_url":"https://api.github.com/users/lmdyyh/events{/privacy}","received_events_url":"https://api.github.com/users/lmdyyh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-01-08T15:26:17Z","updated_at":"2017-01-11T08:29:45Z","closed_at":null,"body":"如果一个节点在重启时，Instance初始化时，相关代码\r\nuint64_t llCPInstanceID = m_oCheckpointMgr.GetCheckpointInstanceID() + 1;  \r\n\r\n    uint64_t llNowInstanceID = llCPInstanceID;\r\n    if (llNowInstanceID < m_oAcceptor.GetInstanceID())\r\n    {\r\n        ret = PlayLog(llNowInstanceID, m_oAcceptor.GetInstanceID());  \r\n        if (ret != 0)\r\n        {\r\n            return ret;\r\n        }\r\n\r\n        PLGImp(\"PlayLog OK, begin instanceid %lu end instanceid %lu\", llNowInstanceID, m_oAcceptor.GetInstanceID());\r\n\r\n        llNowInstanceID = m_oAcceptor.GetInstanceID();\r\n    }\r\n    else\r\n    {\r\n        if (llNowInstanceID > m_oAcceptor.GetInstanceID())\r\n        {\r\n            ret = ProtectionLogic_IsCheckpointInstanceIDCorrect(llNowInstanceID, m_oAcceptor.GetInstanceID());\r\n            if (ret != 0)\r\n            {\r\n                return ret;\r\n            }\r\n            m_oAcceptor.InitForNewPaxosInstance();\r\n        }\r\n        \r\n        m_oAcceptor.SetInstanceID(llNowInstanceID);\r\n    }\r\n在if分支中会将llNowInstanceID到m_oAcceptor.GetInstanceID()的日志对状态机进行重放，从而恢复状态机。我的理解是，这里恢复应该是首先加载llNowInstanceID－1，即此CheckpointInstanceID时落盘的数据，然后重放llNowInstanceID到m_oAcceptor.GetInstanceID()的日志才能恢复所有的数据。"},"comment":{"url":"https://api.github.com/repos/tencent-wechat/phxpaxos/issues/comments/271807886","html_url":"https://github.com/tencent-wechat/phxpaxos/issues/42#issuecomment-271807886","issue_url":"https://api.github.com/repos/tencent-wechat/phxpaxos/issues/42","id":271807886,"user":{"login":"lmdyyh","id":4398247,"avatar_url":"https://avatars.githubusercontent.com/u/4398247?v=3","gravatar_id":"","url":"https://api.github.com/users/lmdyyh","html_url":"https://github.com/lmdyyh","followers_url":"https://api.github.com/users/lmdyyh/followers","following_url":"https://api.github.com/users/lmdyyh/following{/other_user}","gists_url":"https://api.github.com/users/lmdyyh/gists{/gist_id}","starred_url":"https://api.github.com/users/lmdyyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmdyyh/subscriptions","organizations_url":"https://api.github.com/users/lmdyyh/orgs","repos_url":"https://api.github.com/users/lmdyyh/repos","events_url":"https://api.github.com/users/lmdyyh/events{/privacy}","received_events_url":"https://api.github.com/users/lmdyyh/received_events","type":"User","site_admin":false},"created_at":"2017-01-11T08:29:45Z","updated_at":"2017-01-11T08:29:45Z","body":"感谢耐心解答！！！"}}
{"actor":{"display_login":"lmdyyh"}}