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

[BAR] udf is not remaped to different scope using --map-data

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.0.2
    • 7.0.1
    • 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 remap
        • ./cbbackupmgr restore -a /backup-1 -r my_backup -c http://localhost:8091 -u Administrator -p password --map-data bucket1.scope1.collection1=bucket1.scope3.collection3
        • or
        • ./cbbackupmgr restore -a /backup-1 -r my_backup -c http://localhost:8091 -u Administrator -p password --map-data bucket1.scope1=bucket1.scope3
      • 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 and not scope3:

      [root@cluster bin]# ./cbq -u Administrator -p password
       Connected to : http://localhost:8091/. Type Ctrl-D or \QUIT to exit.
       
       
       Path to history file for the shell : /root/.cbq_history 
      cbq> select f.identity.name, f.identity.type, f.identity.`scope` from system:functions as f;
      {
          "requestID": "7ff668f3-d201-4680-b768-7da78faaf4ee",
          "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

        Activity

          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:

              PagerDuty