# HG changeset patch # User one # Date 1287900443 -32400 # Node ID 4bcc6b563d52d9d076d1f7c16a6e138ab7b220ac # Parent 138f3b33aa5e4ffe824577fedc7144c9d4eab488 looks like working now. diff -r 138f3b33aa5e -r 4bcc6b563d52 Todo --- a/Todo Sun Oct 24 14:19:52 2010 +0900 +++ b/Todo Sun Oct 24 15:07:23 2010 +0900 @@ -11,8 +11,16 @@ 一周後に、それより前のcommandは来ないので、そこまで 確定させて良い。(sentListから削除) +自分のcommandがsortされないで残る感じ? + unMergeCmds がないので、mergeAgain を作り直す必要がある。 +editor のseqは、sm 側で付けなおす必要がある。 + +editor間のトポロジーが狂うバグがあるらしい + 1->2->1->3 +のような。 + Sat Oct 23 22:24:31 JST 2010 Editor1 Editor2 Editor3 diff -r 138f3b33aa5e -r 4bcc6b563d52 rep/handler/Editor.java --- a/rep/handler/Editor.java Sun Oct 24 14:19:52 2010 +0900 +++ b/rep/handler/Editor.java Sun Oct 24 15:07:23 2010 +0900 @@ -126,7 +126,9 @@ checkReturnedCommand(command); checkQuit(); return; - } + } else if (mergeMode==MergeMode.Direct) { + truncateUnMergedCmds(command); + } // Second Phase が終わって同期が終了。 // SessionManager.logger.writeLog("Complete "+command); checkAck(command); @@ -168,7 +170,7 @@ checkAck(command); sendAck(command); } else if (mergeMode==MergeMode.Direct) { - truncateUnMergedCmds(command); + // truncateUnMergedCmds(command); checkAck(command); sendAck(command); } else { @@ -616,6 +618,7 @@ public REPCommand transSendCmd(REPCommand cmd){ assert(cmd.eid==eid); + cmd.seq = seq(); // renumber editor's seq //マージ中にユーザから割り込みがあった場合 if(isMerging()){ logger.writeLog("mergeAgain"+eid+":"+cmd); @@ -737,8 +740,8 @@ public int compare(REPCommand o1, REPCommand o2) { int eid1 = o1.eid-base; if (eid1<0) eid1 += Integer.MAX_VALUE; int eid2 = o2.eid-base; if (eid2<0) eid2 += Integer.MAX_VALUE; - if ( gSeq(o1)gSeq(o2) ) return 1; + if ( gSeq(o1.seq)gSeq(o2.seq) ) return 1; if ( eid1eid2 ) return 1; if ( o1.seq= seq / gseqLimit) { - setSeq((gSeq(cmd)/gseqLimit+1)*gseqLimit); + if (gSeq(cmd.seq) >= gSeq(seq)) { + setSeq((gSeq(cmd.seq)+1)*gseqLimit); } }