← Back to team overview

graphite-dev team mailing list archive

[Question #239344]: replication_factor=2 and whisper files creation conflict

 

New question #239344 on Graphite:
https://answers.launchpad.net/graphite/+question/239344

Hello

I have next setup: two identical graphite servers, each server running single webapp, single carbon-relay and two carbon-caches. 
Each carbon-relay spreads metrics between all four carbon-caches using consistent hashing.
Each pair of carbon-caches share single LOCAL_DATA_DIR. webapp also looks for data in this directory.

All goes well until I try to use replication_factor = 2.  When I try to enable replication_factor =2 I receive several exceptions like:

16/11/2013 20:55:10 :: Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 505, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 207, in _worker
    result = context.call(ctx, function, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/opt/graphite/lib/carbon/writer.py", line 149, in writeForever
    writeCachedDataPoints()
  File "/opt/graphite/lib/carbon/writer.py", line 121, in writeCachedDataPoints
    settings.WHISPER_FALLOCATE_CREATE)
  File "/usr/lib/pymodules/python2.7/whisper.py", line 361, in create
    raise InvalidConfiguration("File %s already exists!" % path)
whisper.InvalidConfiguration: File /opt/graphite/storage/whisper/metrics/mymetric.wsp already exists!

I think the problem is that both of these replicas come to the pair of carbon-cache that run on the given server and they both trying to create the same wsp.

My final goal is to separate data replicas between servers so that hardware crash on single server disk will not lead to data loss. But it looks like I have no control on where replicas are placed.

-- 
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.