Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-19397

Thin 3.0: Return an error to client when outdated schema is used

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0-beta1
    • 3.0.0-beta2
    • thin client

    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

          Activity

            People

              ptupitsyn Pavel Tupitsyn
              ptupitsyn Pavel Tupitsyn
              Igor Sapego Igor Sapego
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m