error retry-not-idempotent
What it means#
Retrying a call that changes state is dangerous, so @retry is only allowed together with @idempotent or @readonly.
Example#
service Pay {
@retry(3) // <- retry-not-idempotent
rpc charge(x: i32) -> i32
}error
retry-not-idempotent
How to fix#
Add @idempotent(key: r => …) (the server stores the response per key) or @readonly.