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

Make DDL operations resilient to orphan parent->child linking rows in SYSTEM.CHILD_LINK

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 5.0.0, 4.15.0
    • 5.1.0, 4.16.0
    • None
    • None

    Description

      We are targeting PHOENIX-6141 for 4.17. Until we have it, we should aim at making DDL operations resilient to orphan parent->child linking rows. DDL operations identified which can fail due to orphan rows are:

      1. Any ALTER TABLE ADD/DROP/SET calls on the base table T will fail if there are orphan links from T to some already dropped view. This happens because the call to MetaDataEndpointImpl.findAllChildViews() from MetaDataEndpointImpl.mutateColumn() fails with a TableNotFoundException.
      2. Any DROP TABLE/VIEW call without CASCADE will fail even though there are actually no child views since the orphan rows wrongly indicate that there are child views.
      3. During the upgrade path for UpgradeUtil.syncUpdateCacheFreqAllIndexes(), we will just ignore any orphan views (for ex, see this), but the call to UpgradeUtil.upgradeTable() will fail with a TableNotFoundException for each orphan view.
      4. During a CREATE TABLE/VIEW, we try to drop any views from the previous life of that table/view, however we might end up dropping a legitimate view (with the same name) which is on another table/view because of this.

      Before dropping any views that we see from a parent->child link, we need to ensure that the view is in fact a child view of the same table/view we think it is an orphan of.

      Attachments

        1. PHOENIX-6142-4.x-v1.patch
          141 kB
          Chinmay Kulkarni
        2. PHOENIX-6142.master.v1.patch
          149 kB
          Chinmay Kulkarni
        3. PHOENIX-6142.4.x.v4.patch
          146 kB
          Chinmay Kulkarni
        4. PHOENIX-6142.4.x.v3.patch
          147 kB
          Chinmay Kulkarni
        5. PHOENIX-6142.4.x.v2.patch
          146 kB
          Chinmay Kulkarni

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: