Question

Given a working erlang project with multiple modules... wanting to hotplug multiple dependent modules... is the transition to the new modules synchronized (all or none) or are they installed one at a time... such that any transaction in flight could have an unpredictable outcome.

For example:

I have two modules in production... foo and bar. Such that there were dependencies between foo and bar... execution of code moves from foo to bar. Now I have updates to foo and bar and I want to replace them both at the same time. Such that I do not want an event to execute on foo(1) and bar(2), or foo(2) and bar(1).

in a SQL context this would be called a transaction.

Was it helpful?

Solution

It is not done in a transaction, but one at a time. This is something which you have to take care of in the new modules. i.e. if an old module calls a new one you have to make sure that the old interface is still there and does not crash. This in turn makes it very important for you to load the modules in the correct order to avoid an new module calling an old one and expecting an interface to be there.

If you do very small incremental changes to your system this tends to not be a problem, but if you want to do a big bang upgrade once every year it will become more and more complex.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top