Skip to content

Commit

Permalink
follower ignore read operation. (#798)
Browse files Browse the repository at this point in the history
  • Loading branch information
horizonzy authored Mar 25, 2022
1 parent a77c4d0 commit 08b5348
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ public byte getOp() {
return op;
}

public boolean isReadOp() {
return GET == this.op || MULTI_GET == this.op || SCAN == this.op || CONTAINS_KEY == this.op
|| REVERSE_SCAN == this.op;
}

public int getStep() {
return (Integer) this.attach;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ public void onApply(final Iterator it) {
} else {
kvOp = this.serializer.readObject(buf, KVOperation.class);
}
// follower ignore read operation
if (kvOp != null && kvOp.isReadOp()) {
++index;
it.next();
continue;
}
} catch (final Throwable t) {
++index;
throw new StoreCodecException("Decode operation error", t);
Expand Down

0 comments on commit 08b5348

Please sign in to comment.