fix: migration commands must have consistency set to ALL

- the migration commands need to have the consistency level set to ALL
- max schema agreement time is bumped up to 30 seconds

Change-Id: I2940de1b81a630ea4cea305c3855ef78de9b5733
This commit is contained in:
Sriram Madapusi Vasudevan 2015-04-14 11:26:11 -04:00
parent cfd1b82e19
commit 7516fbe63c
2 changed files with 6 additions and 2 deletions

View File

@ -70,7 +70,7 @@ password = cassandra_password
# requires the datacenter option in [DEFAULT] to be configured.
load_balance_strategy = RoundRobinPolicy
consistency_level = ONE
max_schema_agreement_wait = 10
max_schema_agreement_wait = 30
keyspace = poppy
# Replication strategy to use for the keyspace. This value is plugged into
# `map` as show in the syntax here: http://www.datastax.com/documentation/cql/3

View File

@ -15,6 +15,7 @@
"""Cassandra storage driver implementation."""
import copy
import multiprocessing
import os
import ssl
@ -118,7 +119,10 @@ def _connection(conf, datacenter, keyspace=None):
except cassandra.InvalidRequest:
_create_keyspace(session, keyspace, conf.replication_strategy)
_run_migrations(conf.migrations_path, session)
migration_session = copy.copy(session)
migration_session.default_consistency_level = \
getattr(cassandra.ConsistencyLevel, 'ALL')
_run_migrations(conf.migrations_path, migration_session)
session.row_factory = query.dict_factory