-
Notifications
You must be signed in to change notification settings - Fork 54
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
panic: valid partial linearization returned non-ok result from model step #25
Comments
Yes, but Porcupine's linearizability checker does not actually rely on this / doesn't even look at the Client IDs. The example history you gave, from the linearizability checker's perspective, is equivalent to:
To make this more readable in the visualizer, you could consider synthesizing multiple client IDs when you have such a situation, like
I don't think the above should cause this issue. I think this means that either (1) your model's behavior doesn't satisfy Porcupine's requirement on models (e.g., your model is nondeterministic, or your model's If you can add persistence so you save the history in case you encounter this again, and you can share the history + model, that would be really helpful for investigating further. |
Thanks @anishathalye. This narrows down what I should look for. My model does not override I will look through the code again for any unintended non-determinism. My prime suspect is map iteration. (My model also relies on json but I don't use json equal as Go's native json implementation randomizes order and some other aspects) Within the porcupine's code, there is one map iteration checker.go:330 in the checkParallel function.
I'll update you if I could reproduce this issue again. |
The map iteration order you pointed to in Porcupine shouldn't cause any issues. |
I got the exact same error. After hours of debugging, I found the cause of this error in my case is using duplicate IDs. For this history I got the error (The numbers in front of Event are IDs):
I had three PUT operations followed by GETs. There's only one outstanding operation at a time, so return event immediately follows call event. After using distinct IDs for GETs the problem went away. The interesting point is that during
|
Yes, IDs need to be unique to a single operation or a single call/return pair for an event, this is a precondition of all the Some things we could do:
|
I think it’s clear that IDs need to be unique, so adding to the doc probably won’t add much. It’s just if the trace generator has a bug, like what happened to me, the error message could be misleading. I guess your model is the suspect when you see an error like this. Anyway, I’d rather pay that small runtime validation overhead. |
CheckEvent* functions have IDs, but in my case, I use CheckOperation* functions, as they don't have IDs, that may not be the issue. that said, I couldn't reliably reproduce this issue. |
When testing a history using porcupine, I got this error once. It wasn't reproducible, but I still wanted to report it, just in case.
The history matched as linearizable and but failed to generate the visualization.
I somehow suspect this could be caused due to a trick that I use to test systems that are not actually linearizable in traditional definition but follows a specific model. For example, if a method TransferMultiple transfers 3 dollars in 3 steps with $1 in each step.
Here this operation will not appear as a single atomic action, but 3 individual atomic actions. At the same time, I need to ensure each inc a and dec b happens atomically.
Therefore when generating the history, when TransferMultiple operation is called, I create 2 additional virtual operations with exactly same start and end times.
The important thing here is, the same Client: 1 did 3 things at the same time. From my understanding, this is generally not a typical expectation as a single thread should have a single operation at any point in time.
(Here, Ideally, I would've liked the TransferMultiple call to be listed first, but the porcupine HTML generator puts the last listed operation title over the other two so I need to reorder it)
The model that uses the state graph from the formal specification would put mark a specific order (21, 19, 20) as linearizable.
I am not sure if this caused the
panic
, but I am wondering if this could have caused the issue. Since I cannot reproduce this issue, I couldn't narrow down the cause.The text was updated successfully, but these errors were encountered: