Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-47572

[BAR] udf is not excluded during restore using --exclude-data option

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 7.0.1
    • 7.0.2
    • query
    • Centos7
      7.0.1-5956-enterprise
    • Untriaged
    • 1
    • Unknown

    Description

      To repro:

      • create bucket1 and bucket2
      • create scope/collections:
        • create scope bucket1.scope1;
        • create scope bucket2.scope2;
        • create collection bucket1.scope1.collection1;
        • create collection bucket2.scope2.collection2;
      • create UDF:
        • CREATE FUNCTION func1() { 0 };
        • CREATE FUNCTION default:bucket1.scope1.func1() { 0 };
        • CREATE FUNCTION default:bucket2.scope2.func1() { 0 };
      • Check system cat:
        • select f.identity.name, f.identity.type, f.identity.`scope` from system:functions as f;
      • Backup:
        • ./cbbackupmgr config -a /backup-1 -r my_backup
        • ./cbbackupmgr backup -a /backup-1 -r my_backup -c http://localhost:8091 -u Administrator -p password
      • Drop functions:
        • drop function default:bucket1.scope1.func1;
        • drop function default:bucket2.scope2.func1;
      • Restore with exclude
        • ./cbbackupmgr restore -a /backup-1 -r my_backup -c http://localhost:8091 -u Administrator -p password --exclude-data bucket2.scope2.collection2
        • or
        • ./cbbackupmgr restore -a /backup-1 -r my_backup -c http://localhost:8091 -u Administrator -p password --exclude-data bucket2.scope2
      • Check system cat:
        • select f.identity.name, f.identity.type, f.identity.`scope` from system:functions as f;

      Post restore I still see both func1 for scope1 and scope2 present:

      cbq> select f.identity.name, f.identity.type, f.identity.`scope` from system:functions as f;
      {
          "requestID": "f5a86000-9744-4410-ac02-881a9ecfacc4",
          "signature": {
              "name": "json",
              "scope": "json",
              "type": "json"
          },
          "results": [
          {
              "name": "func1",
              "scope": "scope2",
              "type": "scope"
          },
          {
              "name": "func1",
              "scope": "scope1",
              "type": "scope"
          },
          {
              "name": "func1",
              "type": "global"
          } 

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          pierre.regazzoni Pierre Regazzoni created issue -
          pierre.regazzoni Pierre Regazzoni made changes -
          Field Original Value New Value
          Description To repro:
           * create bucket1 and bucket2
           * create scope/collections:
           ** create scope bucket1.scope1;

           ** create scope bucket2.scope2;

           ** create collection bucket1.scope1.collection1;

           ** create collection bucket2.scope2.collection2;

           * create UDF:
           ** CREATE FUNCTION func1() \{ 0 };

           ** CREATE FUNCTION default:bucket1.scope1.func1() \{ 0 };

           ** CREATE FUNCTION default:bucket2.scope2.func1() \{ 0 };

           * Check system cat:
           ** select f.identity.name, f.identity.type, f.identity.`scope` from system:functions as f;

           * Backup:
           ** ./cbbackupmgr config -a /backup-1 -r my_backup

           ** ./cbbackupmgr backup -a /backup-1 -r my_backup -c http://localhost:8091 -u Administrator -p password

           * Drop functions:
           ** drop function default:bucket1.scope1.func1;

           ** drop function default:bucket2.scope2.func1;

           * Restore with exclude
           ** ./cbbackupmgr restore -a /backup-1 -r my_backup -c http://localhost:8091 -u Administrator -p password --exclude-data bucket2.scope2.collection2

           ** or
           ** ./cbbackupmgr restore -a /backup-1 -r my_backup -c http://localhost:8091 -u Administrator -p password --exclude-data bucket2.scope2

           * Check system cat:
           ** select f.identity.name, f.identity.type, f.identity.`scope` from system:functions as f;

          Post restore I still both func1 for scope1 and scope2 present:
          {code:java}
          cbq> select f.identity.name, f.identity.type, f.identity.`scope` from system:functions as f;
          {
              "requestID": "f5a86000-9744-4410-ac02-881a9ecfacc4",
              "signature": {
                  "name": "json",
                  "scope": "json",
                  "type": "json"
              },
              "results": [
              {
                  "name": "func1",
                  "scope": "scope2",
                  "type": "scope"
              },
              {
                  "name": "func1",
                  "scope": "scope1",
                  "type": "scope"
              },
              {
                  "name": "func1",
                  "type": "global"
              } {code}
          To repro:
           * create bucket1 and bucket2
           * create scope/collections:
           ** create scope bucket1.scope1;
           ** create scope bucket2.scope2;
           ** create collection bucket1.scope1.collection1;
           ** create collection bucket2.scope2.collection2;

           * create UDF:
           ** CREATE FUNCTION func1() \{ 0 };
           ** CREATE FUNCTION default:bucket1.scope1.func1() \{ 0 };
           ** CREATE FUNCTION default:bucket2.scope2.func1() \{ 0 };

           * Check system cat:
           ** select f.identity.name, f.identity.type, f.identity.`scope` from system:functions as f;

           * Backup:
           ** ./cbbackupmgr config -a /backup-1 -r my_backup
           ** ./cbbackupmgr backup -a /backup-1 -r my_backup -c [http://localhost:8091|http://localhost:8091/] -u Administrator -p password

           * Drop functions:
           ** drop function default:bucket1.scope1.func1;
           ** drop function default:bucket2.scope2.func1;

           * Restore with exclude
           ** ./cbbackupmgr restore -a /backup-1 -r my_backup -c [http://localhost:8091|http://localhost:8091/] -u Administrator -p password --exclude-data bucket2.scope2.collection2
           ** or
           ** ./cbbackupmgr restore -a /backup-1 -r my_backup -c [http://localhost:8091|http://localhost:8091/] -u Administrator -p password --exclude-data bucket2.scope2

           * Check system cat:
           ** select f.identity.name, f.identity.type, f.identity.`scope` from system:functions as f;

          Post restore I still see both func1 for scope1 and scope2 present:
          {code:java}cbq> select f.identity.name, f.identity.type, f.identity.`scope` from system:functions as f;
          {
              "requestID": "f5a86000-9744-4410-ac02-881a9ecfacc4",
              "signature": {
                  "name": "json",
                  "scope": "json",
                  "type": "json"
              },
              "results": [
              {
                  "name": "func1",
                  "scope": "scope2",
                  "type": "scope"
              },
              {
                  "name": "func1",
                  "scope": "scope1",
                  "type": "scope"
              },
              {
                  "name": "func1",
                  "type": "global"
              } {code}
          owend Daniel Owen made changes -
          Assignee Kamini Jagtiani [ kamini.jagtiani ] James Lee [ james.lee ]
          james.lee James Lee made changes -
          Component/s tools [ 10223 ]
          james.lee James Lee made changes -
          Assignee James Lee [ james.lee ] Kamini Jagtiani [ kamini.jagtiani ]
          james.lee James Lee made changes -
          Attachment dump-filtered.pcap [ 152095 ]
          kamini.jagtiani Kamini Jagtiani (Inactive) made changes -
          Assignee Kamini Jagtiani [ kamini.jagtiani ] Marco Greco [ marco.greco ]
          pierre.regazzoni Pierre Regazzoni made changes -
          Labels backup backup functional-test
          marco.greco Marco Greco made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          marco.greco Marco Greco made changes -
          Assignee Marco Greco [ marco.greco ] Pierre Regazzoni [ JIRAUSER25157 ]
          pierre.regazzoni Pierre Regazzoni made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          lynn.straus Lynn Straus made changes -
          Fix Version/s 7.0.2 [ 18012 ]
          lynn.straus Lynn Straus made changes -
          Fix Version/s 7.0.1 [ 17104 ]

          People

            pierre.regazzoni Pierre Regazzoni
            pierre.regazzoni Pierre Regazzoni
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty