I have my backend Flask server connected to Cassandra and I'm seeing Cassandra becomes unavailable for a short time every 1 hour. I'm using cassandra-driver==3.25.0
.
2024-12-24T16:07:00.363156408Z Traceback (most recent call last):
2024-12-24T16:07:00.363163598Z File "cassandra/cluster.py", line 3522, in cassandra.cluster.ControlConnection._reconnect_internal
2024-12-24T16:07:00.363166032Z File "cassandra/cluster.py", line 3544, in cassandra.cluster.ControlConnection._try_connect
2024-12-24T16:07:00.363168189Z File "cassandra/cluster.py", line 1620, in cassandra.cluster.Cluster.connection_factory
2024-12-24T16:07:00.363170583Z File "cassandra/connection.py", line 831, in cassandra.connection.Connection.factory
2024-12-24T16:07:00.363176028Z File "/usr/local/lib/python3.7/site-packages/cassandra/io/libevreactor.py", line 267, in __init__
2024-12-24T16:07:00.363178247Z self._connect_socket()
2024-12-24T16:07:00.363180375Z File "cassandra/connection.py", line 898, in cassandra.connection.Connection._connect_socket
2024-12-24T16:07:00.363182758Z ConnectionRefusedError: [Errno 111] Tried connecting to [('172.18.0.5', 9042)]. Last error: Connection refused
I did a bit of research and found out that Cassandra internally perform index summaries distribution periodically (once every 60 minutes by default).
2024-12-25T16:10:46.731537895Z INFO [IndexSummaryManager:1] 2024-12-26 01:10:46,730 IndexSummaryRedistribution.java:77 - Redistributing index summaries
2024-12-25T17:10:46.744763561Z INFO [IndexSummaryManager:1] 2024-12-26 02:10:46,743 IndexSummaryRedistribution.java:77 - Redistributing index summaries
2024-12-25T18:10:46.752774412Z INFO [IndexSummaryManager:1] 2024-12-26 03:10:46,751 IndexSummaryRedistribution.java:77 - Redistributing index summaries
I have only a single cluster deployed for Cassandra so I'm wondering if this is the reason the above behavior is happenning because there is no node availble to handle the queries while doing the redistribution thing.
Hopefully someone can shed a light on this for me. Thank you.