empiredan commented on code in PR #2249:
URL:
https://github.com/apache/incubator-pegasus/pull/2249#discussion_r2108129319
##########
src/replica/replica_2pc.cpp:
##########
@@ -239,13 +239,18 @@ void replica::on_client_write(dsn::message_ex *request,
bool ignore_throttling)
bool replica::need_reject_non_idempotent(const task_spec *spec) const
{
if (!is_duplication_master()) {
+ // This is not the dup master that needs to duplicate writes to
followers, thus
+ // non-idempotent requests are accepted.
return false;
}
if (_app_info.atomic_idempotent) {
+ // Since the table which this replica belongs to has been configured
to make
+ // all atomic write requests idempotent, certainly they are accepted.
return false;
}
+ // Any atomic write request should be rejected.
Review Comment:
To be precise, it refers to **non-idempotent writes**; of course, in the
current implementation of Pegasus, non-idempotent writes are essentially
equivalent to **atomic writes**.
In fact, the code here is already quite clear—adding comments might actually
cause ambiguity—so I’ve removed the comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]