Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-5008

CQSI.init should not bubble up RetriableUpgradeException to client in case of an UpgradeRequiredException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.15.0, 5.1.0, 4.14.2
    • None
    • None

    Description

      Inside ConnectionQueryServicesImpl.init, if we catch a RetriableUpgradeException, we re-throw this exception. In its caller methods for example, in PhoenixDriver.getConnectionQueryServices, this is caught as a SQLException, and this fails the initialization of the ConnectionQueryServices and removes the new CQS object from the cache.

      In the case that the RetriableUpgradeException is an instance of an UpgradeNotRequiredException or an UpgradeInProgressException, this can only occur when we attempt to upgrade system tables, either wrongly or concurrently when there is an ongoing attempt for the same. In this case, it is fine to bubble the exception up to the end client and the client will subsequently have to re-attempt to create a connection (calling CQS.init again).

      However, if the RetriableUpgradeException is an instance of an UpgradeRequiredException, the end-client will never be able to get a connection and thus will never be able to manually run "EXECUTE UPGRADE". In this case, instead of re-throwing the exception, we should log that the client must manually run "EXECUTE UPGRADE" before being able to run any other commands and let the CQS.init succeed. Thus, the client will get a connection which has "upgradeRequired" set and this connection will fail for any query except "EXECUTE UPGRADE".

      Attachments

        1. PHOENIX-5008.patch
          10 kB
          Chinmay Kulkarni
        2. PHOENIX-5008-4.x-HBase-1.3_addendum.patch
          1 kB
          Chinmay Kulkarni

        Issue Links

          Activity

            People

              ckulkarni Chinmay Kulkarni
              ckulkarni Chinmay Kulkarni
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: