-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cas error on newer signed packages #126
Comments
If
If you on the other hand tried to replace
You are publishing a newer timestamp than existed regardless, the only thing that matters here is are you aware of the previous packet that was published or not (cas matches), and do you care at all or not (cas is
Long story short, if you don't want to deal with Note: the exception in practice is that if there is an "inflight" publish request going on, on the DHT or Relays, and you set the |
Here is an example of publishing new packet with |
Understood, thank you! Issue can be closed. |
Hey @Nuhvi ! First of all, I am sorry if this is a very stupid question here. I am trying to understand the logic behind
CasFailed
errors. It seems we are throwingCasFailed
errors when the new package to publish has an older timestamp that the existing package in cache as demonstrated by this test:pkarr/pkarr/src/client/tests.rs
Lines 431 to 463 in 4269e68
I am not sure if the test above is meant to test that
t1
is older thant2
or that they are different. The check condition that throws this error checks for inequality:pkarr/pkarr/src/client.rs
Line 302 in 4269e68
If we swap
t1
andt2
around -we are publishing a newer timestamp than existed- we are still throwing theCasFailed
error. This is easy to observe as swappingt2
andt1
in the test above still passes (sameCasFailed
error).So here is the stupid question: is the intention of the
CasFailed
error to avoid republishing records that are already in cache? Or should it be possible to re-publish an existing signed packet as long as the timestamp is newer than the one found in cache?The text was updated successfully, but these errors were encountered: