Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.0.0-beta1
Description
IGNITE-19241 attempts to solve "client inserts data with old schema" problem by sending the latest schema version with every tuple operation response.
However, this approach is not reliable, for example:
1. var view = client.tables().table("FOO").recordView(); view.upsert(...) - now client knows schema v1
2. client.sql().exec("ALTER TABLE FOO ADD COLUMN NEWCOL INT"); - client alters the table, but does not know about schema v2 with new column
3. view.upsert(Tuple.create().set("key", 1).set("NEWCOL", 100)) - v1 is used to send data to the server, NEWCOL is ignored, data is lost. Response says that schema v2 is available, but it is too late.
To ensure that the latest schema is used by the client and no data is lost, we should throw an exception (with a specific error code) from TupleMarshallerImpl when specified schema version is outdated: client will receive an exception (with specific schema version in it), load the specified schema, and retry the operation.
This exception should never be thrown to the user code. We can use an interface on org.apache.ignite.client.handler.requests.table.ClientTuple, something like MatchingSchemaRequired, and TupleMarshallerImpl will only perform the check in that case.
IGNITE-19241 should be probably reverted.
Attachments
Issue Links
- blocks
-
IGNITE-19710 .NET: Thin 3.0: Data Streamer schema synchronization
- Resolved
- fixes
-
IGNITE-20106 Check that client schema version matches server-side schema version
- Resolved
- supercedes
-
IGNITE-19241 Java thin 3.0: propagate table schema updates to client on write-only operations
- Resolved
-
IGNITE-19242 .NET: Thin 3.0: propagate table schema updates to client on write-only operations
- Closed
- links to