default consistency is now LOCAL_ONE

This commit is contained in:
Adam Holmberg
2015-11-24 11:24:56 -06:00
parent 47b842cc3d
commit 223709aaae
5 changed files with 9 additions and 13 deletions

View File

@@ -1428,7 +1428,7 @@ class Session(object):
.. versionadded:: 2.0.0
"""
default_consistency_level = ConsistencyLevel.LOCAL_QUORUM
default_consistency_level = ConsistencyLevel.LOCAL_ONE
"""
The default :class:`~ConsistencyLevel` for operations executed through
this session. This default may be overridden by setting the
@@ -1438,7 +1438,7 @@ class Session(object):
.. versionchanged:: 3.0.0
default changed from ONE to LOCAL_QUORUM
default changed from ONE to LOCAL_ONE
"""
max_trace_wait = 2.0

View File

@@ -97,7 +97,7 @@
.. autoattribute:: default_timeout
.. autoattribute:: default_consistency_level
:annotation: = LOCAL_QUORUM
:annotation: = LOCAL_ONE
.. autoattribute:: row_factory

View File

@@ -327,12 +327,9 @@ The consistency level used for a query determines how many of the
replicas of the data you are interacting with need to respond for
the query to be considered a success.
By default, :attr:`.ConsistencyLevel.LOCAL_QUORUM` will be used for all queries.
This is to provide unsurprising default behavior with respect to read-after-write
consistency. However, many applications will prefer :attr:`.ConsistencyLevel.ONE`
to maximize performance and availability.
By default, :attr:`.ConsistencyLevel.LOCAL_ONE` will be used for all queries.
You can specify a different default for the session on :attr:`.Session.default_consistency_level`.
To specify a different consistency level per request, you will need to wrap your queries
To specify a different consistency level per request, wrap queries
in a :class:`~.SimpleStatement`:
.. code-block:: python

View File

@@ -12,11 +12,10 @@ previously supported versions. In addition to substantial internal rework,
there are several updates to the API that integrators will need
to consider:
Default consistency is now ``LOCAL_QUORUM``
Default consistency is now ``LOCAL_ONE``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Previous value was ``ONE``. ``ONE`` (or ``LOCAL_ONE``) is still appropriate for
many applications, but the new default was chosen to be least surprising for
new users not specifying a consistency level.
Previous value was ``ONE``. The new value is introduced to mesh with the default
DC-aware load balancing policy and to match other drivers.
Execution API Updates
^^^^^^^^^^^^^^^^^^^^^

View File

@@ -114,7 +114,7 @@ class TestConsistency(BaseConsistencyTest):
def test_default_consistency(self):
# verify global assumed default
self.assertEqual(Session.default_consistency_level, ConsistencyLevel.LOCAL_QUORUM)
self.assertEqual(Session.default_consistency_level, ConsistencyLevel.LOCAL_ONE)
# verify that this session default is set according to connection.setup
# assumes tests/cqlengine/__init__ setup uses CL.ONE