Skip to content

Commit 7894323

Browse files
committed
fix: reset column caches on InvalidQueryException
If a projected query fails with InvalidQueryException (e.g. a column was dropped from a system table between connections), call projection.reset() before signalling a reconnect. This ensures the next connection starts with all caches null and re-discovers available columns via SELECT *, rather than re-sending the now-invalid projected query. Locations updated: - selectPeersFuture: system.peers_v2 onFailure (downgrade path) — changed resetPeers() to reset() so the stale peersV2Columns is also cleared - selectPeersFuture: system.peers onFailure — added reset() on InvalidQueryException before propagating the failure - refreshNodeListAndTokenMap: ExecutionException catch — added reset() when cause is InvalidQueryException - refreshNodeInfo: ExecutionException catch — same
1 parent 512401d commit 7894323

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

driver-core/src/main/java/com/datastax/driver/core/SystemColumnProjection.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,6 @@ void populatePeersV2(ResultSet rs) {
189189
}
190190
}
191191

192-
/**
193-
* Resets the {@code system.peers} column cache only. Used when downgrading from {@code
194-
* system.peers_v2} to {@code system.peers} so that the first peers query re-discovers columns.
195-
*/
196-
void resetPeers() {
197-
peersColumns = null;
198-
}
199-
200192
/**
201193
* Resets all column caches so that the next query to each system table sends {@code SELECT *} and
202194
* re-discovers available columns. Called on reconnection and on schema errors.

0 commit comments

Comments
 (0)