TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Faux Idempotency

22 pointsby l0b0over 3 years ago

5 comments

staticassertionover 3 years ago
Is this a typical definition of idempotency? One where you have to be idempotent even when another system is in play? I wouldn't expect anything to be idempotent if something else can come along and change arbitrary state.
评论 #30043438 未加载
评论 #30043441 未加载
评论 #30043422 未加载
评论 #30123444 未加载
henrydarkover 3 years ago
In simple mathematical terms idempotency is A such that AA=A.<p>Let X be the action &quot;all your servers crashed and were deleted&quot;. The piece is saying that AXA is not necessarily A.<p>Indeed.
theamkover 3 years ago
Faux idempotency exists, but this blog post does not illustrate it.<p>The post-condition of &quot;touch file.txt&quot; is to &quot;make sure that file.txt exists and is writeable by user&quot;. As long as the command succeeds, that post-condition will be true. This makes command idempotent. Note that a bad permission, FS errors, or even running out of disk space will cause the command to fail. This is fine, idempotency talks about what happens if operation was applied. If it could not be applied, no promises are made.<p>Yes, &quot;&gt;&gt;&quot; is generally not idempotent except some circumstances. You can make an idempotent system out of it, but you have to be careful. Nothing &quot;faux&quot; there.<p>The same rules deal with limited resources -- there are no guarantees your tests may run, only that if they do run, they run in identical way.
koprulusectorover 3 years ago
For the record, `&gt;&gt; file.txt` will create a file if it doesn’t exist, won’t affect the file contents, and won’t affect modified or access times.
montroserover 3 years ago
Google cache, as the site is having trouble for me at the moment:<p><a href="http:&#x2F;&#x2F;webcache.googleusercontent.com&#x2F;search?q=cache:_QnG_r4UWOsJ:https:&#x2F;&#x2F;paperless.blog&#x2F;faux-idempotency&amp;client=ubuntu&amp;hl=en&amp;gl=us&amp;strip=1&amp;vwsrc=0" rel="nofollow">http:&#x2F;&#x2F;webcache.googleusercontent.com&#x2F;search?q=cache:_QnG_r4...</a>
评论 #30043931 未加载