[storm] questions around "could not serialize access due to concurrent update"
Gustavo Niemeyer
gustavo at niemeyer.net
Wed Feb 25 13:43:44 GMT 2009
>> - How would I go about identifying what I'm doing wrong and debugging it?
>
> It isn't caused by something you're doing wrong.
Forgetting about right or wrong for a moment, many times there are
things you can do to prevent the serialization error from happening
altogether, by modifying the way that your schema and application
work. It all boils down to preventing shared data between multiple
lines of execution (to prevent using the name "thread", since this
affects any number of processes). Unfortunately, that's somewhat
abstract as a suggestion.
As a more directed suggestion, you may try to experiment with running
multiple serializable transactions with psql and analyzing what causes
a serialization problem and what doesn't. This should give you a
better understanding of the behavior, and help you into trying to
imagine alternative ways you could structure your data to prevent it.
Another thing to keep in mind is that in certain cases, the
serializable behavior isn't so important, and thus you can give up on
its guarantees to make use of the benefits of the other modes. Again,
good understanding of what is wanted and the side effects of each mode
is crucial for preventing hard-to-debug failures.
--
Gustavo Niemeyer
http://niemeyer.net
More information about the storm
mailing list