All work
- Fix generated timestamp on retryNODEJS-691
- Adding `madge` to CI to Detect Circular DependencyNODEJS-690
- Resolve Circular Dependency Derived from `clientOptions.continuousPageDefaultHighWaterMark`NODEJS-689
- Dropped support for Node.js v16?NODEJS-688Resolved issue: NODEJS-688Bret McGuire
- Fix retry on socket errorNODEJS-687Resolved issue: NODEJS-687Bret McGuire
- Remove Insights supportNODEJS-686
- [VIRAL VIDEO!] (18)+ Brooke Monk Leaked Video Original Full Video Short Clip Original Link On Social Media Twitter XxXNODEJS-685Resolved issue: NODEJS-685
- ESLint Configuration FIles MigrationNODEJS-684
- Typescript generics for main Client methodsNODEJS-683
- Replace deprecated usages of util.isDate & util.isStringNODEJS-682Resolved issue: NODEJS-682Jane He
- ControlConnection Concurrent Read and Write on .host and .connectionNODEJS-681Jane He
- Update and Automate TypeScript SupportNODEJS-680
- CI of TypeScript Compilation fails due to TypeScript@5.6.2NODEJS-679Resolved issue: NODEJS-679Jane He
- Add node.js 22.x to CINODEJS-678Resolved issue: NODEJS-678Jane He
- Add support for DSE 6.9.x and HCD releases to CINODEJS-677Resolved issue: NODEJS-677Jane He
- DSE Graph test failing against DSE 6.9.0NODEJS-676Resolved issue: NODEJS-676Jane He
- DSE Polygon test failing against DSE 6.9.0NODEJS-675Resolved issue: NODEJS-675Jane He
- Add support for Cassandra 4.1.x and 5.0 releases to CINODEJS-674Resolved issue: NODEJS-674Jane He
- Driver doesn't recognize the next page cursor automatically thus only brings the first page of the query.NODEJS-673
- Batch and prepared=true + use if different TIMESTAMP for each insertNODEJS-672Bret McGuire
- Remove @types/long dependencyNODEJS-671Resolved issue: NODEJS-671Jane He
- ALLOW FILTERING error in implementing UPDATE queryNODEJS-670Resolved issue: NODEJS-670
- ResultSet stops paginating if it sees an empty page (with ALLOW FILTERING)NODEJS-668
- Error on Select query, when one of the column is of type vector (vector column is not indexed) - cassandra 5.0NODEJS-667
- Extend driver vector support to arbitrary subtypes and fix handling of variable length types (OSS C* 5.0)NODEJS-666Resolved issue: NODEJS-666Jane He
- Driver does not work for versions <16.9.0NODEJS-665Resolved issue: NODEJS-665Bret McGuire
- Fix documentation erroneously left out of 4.7.0NODEJS-664Resolved issue: NODEJS-664Bret McGuire
- Update Appveyor configs to use more modern versions of node.jsNODEJS-663
- Client-side query interpolation fails when trying to use a JS int typeNODEJS-662
- Consider unifying functions for parsing fully-qualified type names and short CQL namesNODEJS-661
- ControlConnection unit tests very dependent upon system DNS configurationNODEJS-660Resolved issue: NODEJS-660Bret McGuire
- update dependencies in package*.json to address CVEsNODEJS-659Resolved issue: NODEJS-659Bret McGuire
- unit test failure in test/unit/parser-tests.js for NodeJS 14, 16, 18 and 20 while working in 10 and 12NODEJS-658Resolved issue: NODEJS-658Bret McGuire
- Update Travis configs to use more modern versions of node.jsNODEJS-657Resolved issue: NODEJS-657Bret McGuire
- Support vector typeNODEJS-655Resolved issue: NODEJS-655Bret McGuire
- Update driver test suite to include deno and bunNODEJS-654
- Update supported platforms to reflect more modern versions of node.jsNODEJS-653Resolved issue: NODEJS-653Bret McGuire
- WebSockets supportNODEJS-652
- Getting first connection takes 75 secondsNODEJS-651
- Encoding issue with map<boolean,int>NODEJS-650Resolved issue: NODEJS-650Bret McGuire
- Improve documentation & handling for NoHostAvailableError Datastax AstraNODEJS-649
- ResultSet.first() should be typed to allow null resultsNODEJS-648
- Log negotiated SSL/TLS versions when using encrypted connectionsNODEJS-647Resolved issue: NODEJS-647Bret McGuire
- Unable to add address for initially unresolved hostNODEJS-646Resolved issue: NODEJS-646Bret McGuire
- Travis builds are failing due to TypeScript errorsNODEJS-645Resolved issue: NODEJS-645Bret McGuire
- Driver should automatically pickup contact points when Stargate is introduced to a clusterNODEJS-644
- In query comments result in errorNODEJS-642
- Node.js application intermittently encountered "socket was closed" errorNODEJS-641Bret McGuire
- Cassandra driver package in node does not stream all rows from Cassandra tableNODEJS-640
- Mapper: Support filtering by SAI index columnNODEJS-639
Fix generated timestamp on retry
Description
Environment
Pull Requests
Fix versions
Activity
Bret McGuire 2 days ago
I think you’re on to something but I think we need to implement a fix at a different spot in the driver.
I’ll take a step back to explain my reasoning. Let’s look at a couple other drivers by way of comparison. The 4.x Java driver retry policy returns the request to be used on retry, although by default this is just the original request. The Python driver does something very similar. They’re able to do this because the driver (a) implements a “handler” object which governs the flow of a given request through it’s lifecycle and (b) maintains the message being sent as state within that handler… and this state includes the request timestamp. The Java driver manages request flow (including retries and speculative executions) via CqlRequestHandler while the message (and it’s timestamp) are represented as a discrete Java object (see the query message as an example). Python does something similar with different constructs; the ResponseFuture returned by exeucteX() calls manages the request lifecycle while request messages (and their timestamps) are encapsulated in Python objects.
The node.js driver does something similar… with an exception that’s pretty relevant to this discussion. There is a common request flow in RequestExecution. This logic looks very similar to the Java and Python examples but note that the stateful request contained here comes from the parent object, a RequestHandler. That request is created within Client but the crucial thing here is that it doesn’t track the request timetsamp. The serialization logic for that request is perfectly fine to let the timestamp be computed by the specified compute function… which gets into the logic you cite above.
It seems to me that the right way to fix this logic is to do something similar to what’s done in the other drivers and persist the timestamp as part of the underlying messages. I’d much rather make that change than modify how default timestamps are generated. This change shouldn’t have much of an impact on other driver functionality but we should definitely make sure we’re covered test-wise for any such change.
I’ll see if I can make this happen shortly… I completely agree with that the current behaviour is pretty clearly wrong on it’s face.
Bret McGuire April 27, 2025 at 8:55 PM
Thanks for the ticket and PR ! I’ll get these materials linked together and either or I will try to get a review for you shortly!
Hello ,
This is a duplicate of Github #438 for reference.
There is an issue with timestamps generated by timestamp generators in
DefaultExecutionOptions
.No matter if the request is prepared or not, any retry, including speculative execution, will generate a new timestamp for the query when starting a new execution for the same request object.
As interpreted by Cassandra, the latest timestamp take precedence. Then, queries executed and marked as successful can be overwritten by past queries when retrying the execution.
The user feels that it is a retry but in fact, it is a new query.
This is done by the
WriteQueue
when callingrequest.write(...)
which callwriteQueryParameters(...)
and thengetOrGenerateTimestamp()
which always generate a new timestamp for each new execution. It should generate one and use it for each consecutive calls to make a retry operation in Cassandra.I did not write any tests for this change since I don't have a proper setup and configuration on my side which cause tests to fail. I think testing on the client side only, like this is enough:
Thank you very much,
Have a good day,
Luc