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

Creating a view which has its own new columns should also do checkAndPut checks on SYSTEM.MUTEX

    XMLWordPrintableJSON

Details

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

    Description

      Currently, when creating a view we do conditional writes with a checkAndPut to SYSTEM.MUTEX for the keys:
      (<physical parent's schema name>, <physical parent's table name>, <column name>)

      for each column in the view WHERE clause. Similarly, when issuing an ALTER TABLE/VIEW, we do a conditional write with a checkAndPut to SYSTEM.MUTEX for the key:
      (<physical parent's schema name>, <physical parent's table name>, <name of the column to add/drop>)

      to prevent conflicting modifications between a base table/view and its child views. However, if we create a view with its own new columns, for ex:

      CREATE VIEW V1 (NEW_COL1 INTEGER, NEW_COL2 INTEGER) AS SELECT * FROM T1 WHERE B = 10;
      

      we will not do a checkAndPut with the new columns being added to the view (NEW_COL1 and NEW_COL2) thus conflicting concurrent mutations may occur to a parent in this case, for ex: a simultaneous ALTER TABLE/VIEW of the parent which adds NEW_COL1 as a VARCHAR. This will lead to data being unable to be read properly.

      Attachments

        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: