Closed dfarr closed 3 days ago
+1 to that from etcd. It would be really useful to get the linearization to be able to validate etcd watch, the eventually consistent stream changes to etcd.
I've added a method that exposes all of the partial linearizations found during the search (including the full linearization, if one exists): https://github.com/anishathalye/porcupine/commit/29dfede859cff80f66808e706f7cdb2fb34bed91.
Note that it won't directly/fully solve your problem: this will only contain partial linearizations (that are fully valid), so if you feed the sequences of operations to your model, you won't see the error. The way the Porcupine visualizer works is that it finds all possible operations that could come next after the partial linearization. You can find the logic here: https://github.com/anishathalye/porcupine/blob/d372c586e14713ae275ab475b916cc2b339200c5/visualization/index.js#L200-L210
If you use the just-added PartialLinearizations()
/ PartialLinearizationsOperations()
, and combine it with logic like that shown above, you should get the info you need to get the error messages from your model.
After calling
CheckOperationsVerbose
and getting a result I would love be able to access the "longest linearizable path" found. In the case of anOk
result this would be equivalent to the path shown in the visualization. In the case of anIllegal
result the visualization can show a few different paths, in this case either the longest or all the paths would be useful to have access to.The reason I am hoping to access this information is because we have written a step function that looks like this
Our dst function returns an updated model and an error that contains additional useful information. In the case where the error is non nil, we report false to porcupine and the error information is effectively lost. If I could access the longest path (I'm hoping for a slice of type
[]porcupine.Operation
) I could feed this information back into our dst model and report the error that occurs, this would be super helpful for debugging and developing.If this is something that is possible and something you are up to add to porcupine I am happy to create a PR :)