Closed hkroger closed 7 years ago
Apparently a race condition with a temporary file
I don't really have good news for you here. This definitely happens, but is also expected to happen. Concurrent operations against a cluster were not something considered in the original design, and short of re-writing the majority of the internals, are not possible.
While it would be nice if operations that make sense to run concurrently, like cqlsh, could be, that's still too much engineering effort.
I don't know if it affects other parts as well but I checked the code and in common.py
methods replaces_in_file
and replaces_or_add_into_file_tail
which use the hardwired tmp file name. If those used e.g. format of file + "." + str(os.getpid()) + ".tmp"
instead of file + ".tmp"
that might help with this particular case.
But as I said, I don't know if other parts of the system are affected as well.
At least this particular problem seems to get fixed with this?
I'd accept that PR then
What do you think: https://github.com/pcmanus/ccm/pull/581
I admit it might be a bit naive approach for this problem but multiple parallel instances would end up creating same conf anyways, right?
I will close this now since the immediate problem is solved with the above PR.
If you run like
ccm node1 cqlsh -e "desc tables;" & ccm node1 cqlsh -e "desc tables;" &ccm node1 cqlsh -e "desc tables;" &ccm node1 cqlsh -e "desc tables;" &ccm node1 cqlsh -e "desc tables;" &ccm node1 cqlsh -e "desc tables;" &ccm node1 cqlsh -e "desc tables;" &
You end up getting: