Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-3534 Support multi region SYSTEM.CATALOG table
  3. PHOENIX-6154

Move the check for existence of child views and task addition to drop those child views to the client side when dropping a table/view

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.0.0, 4.15.0
    • 4.16.2
    • None
    • None

    Description

      When we issue a DROP TABLE/VIEW, if the table/view being dropped has child views (and CASCADE is provided), we add a DropChildViewsTask in the SYSTEM.TASK table (see this). This means that while holding the row lock for the table/view’s header row (here) we do the following:

      1. Make an RPC to the region hosting SYSTEM.CHILD_LINK to scan it in order to find child views.
      2. If any child views are found in the step above, we make additional RPCs to the region hosting SYSTEM.TASK to UPSERT a DropChildViewsTask for immediate child views.
      3. We send remote mutations to drop parent→child links from the SYSTEM.CHILD_LINK table.

      Of the above extra RPCs, note that even if the table/view has no child views or if CASCADE is not provided, we will still do the first RPC from the server while holding a row lock.

      We should move this check to the client (issue a scan against SYSTEM.CHILD_LINK to see if a single linking row exists) and also add the task from the client.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: