Problem
When running the DataStax Java driver v5 smoke test suite against Ferrosa, DROP KEYSPACE IF EXISTS times out. The driver sends the DROP, Ferrosa processes it and emits a SCHEMA_CHANGE event, but the driver never achieves schema agreement and eventually times out (even with a 30s timeout).
Result: 37/38 tests pass. Only DROP KEYSPACE IF EXISTS java_test fails.
Root Cause
After Ferrosa processes a CREATE INDEX DDL, it emits a SCHEMA_CHANGE event. The DataStax Java driver receives this event on its control connection and closes that connection as part of its schema-refresh lifecycle. It then opens short-lived probe connections (~0.5–1ms lifetime) to re-establish a control connection.
When Ferrosa processes the subsequent DROP KEYSPACE, it emits another SCHEMA_CHANGE event. However:
- The old control connection is already closed — the event cannot be delivered to it.
- New probe connections open, receive
STARTUP → REGISTER → system.local + system.peers_v2 queries → close in ~0.5ms.
- Ferrosa delivers the retained
SCHEMA_CHANGE EVENT frame to these probe connections (confirmed via server logs — response_version=0x85 for v5), but the connections close before the driver processes the event.
- The driver schema-agreement logic only processes
SCHEMA_CHANGE events on its designated control connection, not on probe connections.
- The driver never re-establishes a stable control connection that receives the event, so schema agreement never completes and the request times out.
What Was Tried
| Approach |
Result |
Retained event watch channel (3s window) |
37/38 — probe connections close before event is processed |
Retained event watch channel (10s window) |
37/38 — same issue |
| 50ms delay before event emission |
37/38 |
| 200ms delay before event emission |
37/38 |
| 600ms delay before event emission |
37/38 |
Inline event_rx.try_recv() prioritization before frame processing |
37/38 |
| Post-REGISTER inline watch delivery (EVENT sent after READY, before next frame) |
37/38 — EVENT delivered to TCP socket but driver does not treat probe connections as control connection |
| v4/v5 map-format SCHEMA_CHANGE event body |
32/38 — regressed other tests, reverted |
Proposed Fix Directions
-
Schema-version polling fallback: Implement system.local.schema_version polling so the driver can detect schema agreement even when EVENT delivery is missed. Ferrosa already bumps schema_version on every DDL, but the driver may not be polling it correctly.
-
Prevent control connection closure after CREATE INDEX: Investigate why the DataStax driver closes its control connection after receiving the CREATE INDEX schema-change event. Ferrosa may be sending something that causes the driver to close the connection.
-
Direct EVENT write to TCP socket: Bypass the forwarder → event_tx → event_rx → framed.send() pipeline and write EVENT frames directly to the TCP socket from the forwarder task.
Environment
Test
The DROP KEYSPACE IF EXISTS java_test test is currently disabled in the Java smoke test suite (see PR #223) to unblock CI. It should be re-enabled once this is fixed.
References
Problem
When running the DataStax Java driver v5 smoke test suite against Ferrosa,
DROP KEYSPACE IF EXISTStimes out. The driver sends the DROP, Ferrosa processes it and emits aSCHEMA_CHANGEevent, but the driver never achieves schema agreement and eventually times out (even with a 30s timeout).Result: 37/38 tests pass. Only
DROP KEYSPACE IF EXISTS java_testfails.Root Cause
After Ferrosa processes a
CREATE INDEXDDL, it emits aSCHEMA_CHANGEevent. The DataStax Java driver receives this event on its control connection and closes that connection as part of its schema-refresh lifecycle. It then opens short-lived probe connections (~0.5–1ms lifetime) to re-establish a control connection.When Ferrosa processes the subsequent
DROP KEYSPACE, it emits anotherSCHEMA_CHANGEevent. However:STARTUP → REGISTER → system.local + system.peers_v2 queries → closein ~0.5ms.SCHEMA_CHANGEEVENT frame to these probe connections (confirmed via server logs —response_version=0x85for v5), but the connections close before the driver processes the event.SCHEMA_CHANGEevents on its designated control connection, not on probe connections.What Was Tried
watchchannel (3s window)watchchannel (10s window)event_rx.try_recv()prioritization before frame processingProposed Fix Directions
Schema-version polling fallback: Implement
system.local.schema_versionpolling so the driver can detect schema agreement even when EVENT delivery is missed. Ferrosa already bumpsschema_versionon every DDL, but the driver may not be polling it correctly.Prevent control connection closure after CREATE INDEX: Investigate why the DataStax driver closes its control connection after receiving the CREATE INDEX schema-change event. Ferrosa may be sending something that causes the driver to close the connection.
Direct EVENT write to TCP socket: Bypass the
forwarder → event_tx → event_rx → framed.send()pipeline and write EVENT frames directly to the TCP socket from the forwarder task.Environment
feat/cql-protocol-v3-v4-v5-conformance(PR feat(cql): accept and conform to CQL native protocol v5 #223)system.peersandsystem.peers_v2return 0 rows (single node)Test
The
DROP KEYSPACE IF EXISTS java_testtest is currently disabled in the Java smoke test suite (see PR #223) to unblock CI. It should be re-enabled once this is fixed.References
t_56f17a7eferrosa-cql/specs/fmea.mdferrosa-cql/specs/roadmap.md(Next section)