{"action":"created","issue":{"url":"https://api.github.com/repos/krasserm/akka-persistence-cassandra/issues/49","labels_url":"https://api.github.com/repos/krasserm/akka-persistence-cassandra/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/krasserm/akka-persistence-cassandra/issues/49/comments","events_url":"https://api.github.com/repos/krasserm/akka-persistence-cassandra/issues/49/events","html_url":"https://github.com/krasserm/akka-persistence-cassandra/issues/49","id":69665489,"number":49,"title":"ConfigurationException: Column family ID mismatch","user":{"login":"matlockx","id":936786,"avatar_url":"https://avatars.githubusercontent.com/u/936786?v=3","gravatar_id":"","url":"https://api.github.com/users/matlockx","html_url":"https://github.com/matlockx","followers_url":"https://api.github.com/users/matlockx/followers","following_url":"https://api.github.com/users/matlockx/following{/other_user}","gists_url":"https://api.github.com/users/matlockx/gists{/gist_id}","starred_url":"https://api.github.com/users/matlockx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matlockx/subscriptions","organizations_url":"https://api.github.com/users/matlockx/orgs","repos_url":"https://api.github.com/users/matlockx/repos","events_url":"https://api.github.com/users/matlockx/events{/privacy}","received_events_url":"https://api.github.com/users/matlockx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-20T19:45:36Z","updated_at":"2015-04-21T04:50:59Z","closed_at":null,"body":"Hi,\r\n\r\nwhen I start two services with akka persistance and both services try to create the schema at the same time I get a ConfigurationException: Column family ID mismatch\r\nIt seems that it's not really easy to solve:\r\n\r\nhttp://mail-archives.apache.org/mod_mbox/cassandra-user/201411.mbox/%3C20141127142534.Horde.4rUxar8x7aa5JS93x4sdxQ7@www3.nde.ag%3E\r\n\r\nhttps://issues.apache.org/jira/browse/CASSANDRA-8387\r\n\r\nMy proposal would be something like:\r\n\r\n\r\n```scala\r\nretry(3) {\r\n     if (config.keyspaceAutoCreate) session.execute(createKeyspace)\r\n     session.execute(createTable)\r\n}\r\n\r\n@annotation.tailrec\r\n  private def retry[T](n: Int)(fn: => T): T = {\r\n    util.Try { fn } match {\r\n      case util.Success(x) => x\r\n      case _ if n > 1 => retry(n - 1)(fn)\r\n      case util.Failure(e) => throw e\r\n    }\r\n  }\r\n```\r\n\r\nin CassandraJournal and CassandraSnapshotStore. wdyt?\r\nIt's a workaround, I know, but it works so far well in our project. I create a PR if you want\r\n"},"comment":{"url":"https://api.github.com/repos/krasserm/akka-persistence-cassandra/issues/comments/94637866","html_url":"https://github.com/krasserm/akka-persistence-cassandra/issues/49#issuecomment-94637866","issue_url":"https://api.github.com/repos/krasserm/akka-persistence-cassandra/issues/49","id":94637866,"user":{"login":"krasserm","id":202907,"avatar_url":"https://avatars.githubusercontent.com/u/202907?v=3","gravatar_id":"","url":"https://api.github.com/users/krasserm","html_url":"https://github.com/krasserm","followers_url":"https://api.github.com/users/krasserm/followers","following_url":"https://api.github.com/users/krasserm/following{/other_user}","gists_url":"https://api.github.com/users/krasserm/gists{/gist_id}","starred_url":"https://api.github.com/users/krasserm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krasserm/subscriptions","organizations_url":"https://api.github.com/users/krasserm/orgs","repos_url":"https://api.github.com/users/krasserm/repos","events_url":"https://api.github.com/users/krasserm/events{/privacy}","received_events_url":"https://api.github.com/users/krasserm/received_events","type":"User","site_admin":false},"created_at":"2015-04-21T04:50:59Z","updated_at":"2015-04-21T04:50:59Z","body":"Are these two services trying to create the *same* schema concurrently or different schemas?"}}