I've been working on categorizing all of the 45 operations currently defined in ClientProtocol. This is the breakdown of what I've come up with:
Read ops, therefore idempotent:
Write ops that I believe should be marked idempotent:
- mkdirs (in fact, it looks like this op can never return false. It either returns true or throws an exception.)
Write ops I'm unsure about:
- getAdditionalDatanode (I'm not sure this one should even be marked OperationCategory.WRITE - it only gets the readLock)
Write ops that I believe should not be idempotent:
Ops which are more administrative, and arguably shouldn't be in ClientProtocol:
Comments are most welcome. In particular, I'm interested in:
- Does anyone have any insight about the three operations I'm not sure about? We could play it safe at first, and not mark them idempotent. Doing so will result in a few more client failures during an NN fail over, but will not result in correctness issues.
- What to do about the 8 operations which seem administrative in nature?
- Did I misidentify any of the write operations which I believe to be idempotent?
Once we hash these things out a little bit, I'll go ahead and make a patch for it.