SEPURI-SAI-KRISHNA commented on PR #13126:
URL: https://github.com/apache/seatunnel/pull/13126#issuecomment-6910736038

   @DanielLeens Thanks, both are fixed in `431b67528a`, with Option A.
   
   **Issue 1.** The writer no longer continues without the key. If the table is 
missing from the driver metadata, it calls `session.refreshSchema()` once; in 
driver 4.14 that refresh runs even when schema metadata is disabled 
(`MetadataManager.refreshSchema(null, true, true)`). If the key still cannot be 
read, the constructor throws `CASSANDRA-06` naming the table and closes the 
session, so a NULL key can no longer reach the server. 
`nullPrimaryKeyReachesTheServerWithoutTableMetadata` is replaced by:
   
   - `primaryKeyMissingFromTheMetadataIsReadAfterARefresh`: the key is found 
after the refresh, and a NULL key is rejected before any write;
   - `writerFailsAndClosesTheSessionWhenThePrimaryKeyCannotBeRead`;
   - `writerClosesTheSessionWhenThePrepareFails`: a failed `prepare` leaves the 
session open on `dev` too.
   
   Removing the refresh, the failure or the close each fails its test, and 
removing the key check fails the four NULL key tests. I did not add a 
failed-future test, because the metadata-unavailable path no longer submits a 
write. Making a failed async write fail the job in general (Option B) is the 
separate issue promised in the description; I will file it with a reproduction.
   
   **Issue 2.** `primaryKeyColumns` and the package-private constructor now 
have Javadoc: the set is never empty and why a NULL key is rejected before the 
write, and the writer owns the session: `close()` closes it, and so does the 
constructor when it fails.
   
   The EN and ZH incompatible-changes entry now says that the sink reads the 
key from the driver schema metadata when it starts and fails if it cannot.
   
   Fork CI on this head passes 
(https://github.com/SEPURI-SAI-KRISHNA/seatunnel/actions/runs/43797522344): 
`CassandraIT` runs 27 tests with 0 failures on JDK 11 and 17, and the unit test 
jobs pass on Linux and Windows.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to