-
Notifications
You must be signed in to change notification settings - Fork 96
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
Avoid writing unsupported commands to log #205
Comments
Another alternative would be to simply catch any errors thrown by |
@dumbbell @acogoluegnes @dcorbacho - Any thoughts on the above options? |
About command versioning (idea 2), do you mean the code calling Ra would pass a version with each command, as a new argument? Yeah, I feel this is the responsibility the user of Ra and author of the Ra machine to take care of that, not Ra. I prefer your idea of reporting a crash somehow. The Ra API should only return the class, reason and stacktrace of the exception, not the state which could be large and secret. Perhaps the exception and the state could be optionaly logged. |
I also vote for the crash, I think the |
Interesting as I personally would prefer
|
Then I think |
Currently there is no mechanism to protect the ra machine from the scenario where a client writes an unsupported command to the log. When it tries to apply this command the server will crash, irrecoverably (unless support is implemented in the the current machine version). this is particularly tricky for commands that have changed in an unsupported manner, e.g. an additional field in a record. Such changes could well happen during machine upgrades.
There are two possible approaches that I see:
We implement an
is_supported/1
optional callback inra_machine
- before any command is written to the log we call this on the current machine version module returning a boolean. If we returnfalse
the command will either be dropped (if pipelined) or an error will be returned to the caller.We add versioning to all commands such that we can filter any commands greater than the current effective machine version. This breaks the external commands api so for me this is less favoured.
The text was updated successfully, but these errors were encountered: