Skip to content

Commit 97bf563

Browse files
committed
default CL is now LOCAL_QUORUM
PYTHON-416
1 parent 7dbe87b commit 97bf563

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

cassandra/cluster.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,13 +1474,17 @@ class Session(object):
14741474
.. versionadded:: 2.0.0
14751475
"""
14761476

1477-
default_consistency_level = ConsistencyLevel.ONE
1477+
default_consistency_level = ConsistencyLevel.LOCAL_QUORUM
14781478
"""
14791479
The default :class:`~ConsistencyLevel` for operations executed through
14801480
this session. This default may be overridden by setting the
14811481
:attr:`~.Statement.consistency_level` on individual statements.
14821482
14831483
.. versionadded:: 1.2.0
1484+
1485+
.. versionchanged:: 3.0.0
1486+
1487+
default changed from ONE to LOCAL_QUORUM
14841488
"""
14851489

14861490
max_trace_wait = 2.0

docs/api/cassandra/cluster.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@
9898

9999
.. autoattribute:: default_timeout
100100

101+
.. autoattribute:: default_consistency_level
102+
:annotation: = LOCAL_QUORUM
103+
101104
.. autoattribute:: row_factory
102105

103106
.. autoattribute:: default_fetch_size

docs/getting_started.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,12 @@ The consistency level used for a query determines how many of the
327327
replicas of the data you are interacting with need to respond for
328328
the query to be considered a success.
329329
330-
By default, :attr:`.ConsistencyLevel.ONE` will be used for all queries. To
331-
specify a different consistency level, you will need to wrap your queries
330+
By default, :attr:`.ConsistencyLevel.LOCAL_QUORUM` will be used for all queries.
331+
This is to provide unsurprising default behavior with respect to read-after-write
332+
consistency. However, many applications will prefer :attr:`.ConsistencyLevel.ONE`
333+
to maximize performance and availability.
334+
You can specify a different default for the session on :attr:`.Session.default_consistency_level`.
335+
To specify a different consistency level per request, you will need to wrap your queries
332336
in a :class:`~.SimpleStatement`:
333337
334338
.. code-block:: python

0 commit comments

Comments
 (0)