You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every object you read from the state store must be copied before it can be mutated, because mutating the object modifies it outside the raft workflow. The result can be servers having inconsistent state, transactions breaking, or even server panics.
Unfortunately this is hard to statically enforce reliably except over "short distances" in the code. This kind of problem is called "taint analysis". We've done hack projects like #16257 to try to detect these bugs, but the results are currently still very buggy. So we're forced to rely on thorough code review, and even that sometimes fails and we get bugs like #23673
This bug has two parts:
The struct was missing the Copy method
And therefore we didn't call the Copy method
@Juanadelacuesta has suggested in an internal discussion that we could wrap state store methods such that they return Copy interface (Copier? Copyable?) rather than any. That would at least prevent problem 1.
The text was updated successfully, but these errors were encountered:
The Nomad state store architecture guide describes an important constraint on state store methods:
Unfortunately this is hard to statically enforce reliably except over "short distances" in the code. This kind of problem is called "taint analysis". We've done hack projects like #16257 to try to detect these bugs, but the results are currently still very buggy. So we're forced to rely on thorough code review, and even that sometimes fails and we get bugs like #23673
This bug has two parts:
Copy
methodCopy
method@Juanadelacuesta has suggested in an internal discussion that we could wrap state store methods such that they return
Copy
interface (Copier
?Copyable
?) rather thanany
. That would at least prevent problem 1.The text was updated successfully, but these errors were encountered: