Skip to content

Fix stale broken cluster connection in CassandraIO (#39788) - #39803

Open
sharan-malyala wants to merge 2 commits into
apache:release-2.76from
sharan-malyala:cherry-pick-39788
Open

Fix stale broken cluster connection in CassandraIO (#39788)#39803
sharan-malyala wants to merge 2 commits into
apache:release-2.76from
sharan-malyala:cherry-pick-39788

Conversation

@sharan-malyala

Copy link
Copy Markdown
Contributor

This PR fixes an issue in CassandraIO where read operations can fail if the underlying Cassandra Cluster connection is broken due to a transient issue avoiding subsequent work failures.

Previously, ConnectionManager would cache the Cluster and Session and continue to return them even if the cluster was in a broken state, leading to subsequent operation failures.

This change adds a validation step in ConnectionManager.getSession(). If the cached Cluster is found to be closed, the stale references are proactively removed from sessionMap and clusterMap. This ensures that a new, healthy Cluster and Session are transparently recreated via computeIfAbsent.

* Fix for CassandraIO read  connection issue

* Fixed a presubmit failure

* Added test case
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @ahmedabu98 for label java.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@stankiewicz

Copy link
Copy Markdown
Contributor

R: @Amar3tto

@github-actions

Copy link
Copy Markdown
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@sharan-malyala

Copy link
Copy Markdown
Contributor Author

Is it possible to include this fix in 2.76 ? A customer is looking for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants