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

Duplicate named index created on same collection during upgrade from 7.0.3 to 7.0.4

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 7.0.3, 7.0.4
    • secondary-index
    • CBS-7.0.3-7031
      CBS-7.0.4-7261
    • Untriaged
    • Centos 64-bit
    • 1
    • Unknown

    Description

      While testing the below scenario, there are duplicate named secondary indexes exist on same collection for different fields. This was a random tests and no clear path is there to reproduce the scenario. I have provide the detailed description of all the operation I have performed during test

      Steps to reproduce:

      1. Create a 6 node cluster with 7.0.3 - kv-kv-index-index-n1ql-n1ql
      2. Load some data say 10k to collection
      3. create few indexes on some field

        CREATE INDEX `idx_0_0` ON `test`.`test_scope_1`.`test_collection_1`(`Field_4`)

      4. Now run parallel queries to create few indexes and scan request with request_plus consistency while upgrading one node for each of the service. Have an index definition with the different field but same name also.

      CREATE INDEX `idx_0_0` ON `test`.`test_scope_1`.`test_collection_1`(`Field_10`)

      #  Duplicated named index would be created on the same collection.

      1. An explain for below queries refers to same index

        explain select * from `test`.`test_scope_1`.`test_collection_1` where Field_10 is not null;
         
        [
          {
            "plan": {
              "#operator": "Sequence",
              "~children": [
                {
                  "#operator": "IndexScan3",
                  "bucket": "test",
                  "index": "idx_0_0",
                  "index_id": "fb1c043e857b1e47",
                  "index_projection": {
                    "primary_key": true
                  },
                  "keyspace": "test_collection_1",
                  "namespace": "default",
                  "scope": "test_scope_1",
                  "spans": [
                    {
                      "exact": true,
                      "range": [
                        {
                          "inclusion": 0,
                          "low": "null"
                        }
                      ]
                    }
                  ],
                  "using": "gsi"
                },
                {
                  "#operator": "Fetch",
                  "bucket": "test",
                  "keyspace": "test_collection_1",
                  "namespace": "default",
                  "scope": "test_scope_1"
                },
                {
                  "#operator": "Parallel",
                  "~child": {
                    "#operator": "Sequence",
                    "~children": [
                      {
                        "#operator": "Filter",
                        "condition": "((`test_collection_1`.`Field_10`) is not null)"
                      },
                      {
                        "#operator": "InitialProject",
                        "result_terms": [
                          {
                            "expr": "self",
                            "star": true
                          }
                        ]
                      }
                    ]
                  }
                }
              ]
            },
            "text": "select * from `test`.`test_scope_1`.`test_collection_1` where Field_10 is not null;"
          }
        ]
         
         
        explain select * from `test`.`test_scope_1`.`test_collection_1` where Field_4 is not null;
         
        [
          {
            "plan": {
              "#operator": "Sequence",
              "~children": [
                {
                  "#operator": "IndexScan3",
                  "bucket": "test",
                  "index": "idx_0_0",
                  "index_id": "5b1de9b8fc2e8e3f",
                  "index_projection": {
                    "primary_key": true
                  },
                  "keyspace": "test_collection_1",
                  "namespace": "default",
                  "scope": "test_scope_1",
                  "spans": [
                    {
                      "exact": true,
                      "range": [
                        {
                          "inclusion": 0,
                          "low": "null"
                        }
                      ]
                    }
                  ],
                  "using": "gsi"
                },
                {
                  "#operator": "Fetch",
                  "bucket": "test",
                  "keyspace": "test_collection_1",
                  "namespace": "default",
                  "scope": "test_scope_1"
                },
                {
                  "#operator": "Parallel",
                  "~child": {
                    "#operator": "Sequence",
                    "~children": [
                      {
                        "#operator": "Filter",
                        "condition": "((`test_collection_1`.`Field_4`) is not null)"
                      },
                      {
                        "#operator": "InitialProject",
                        "result_terms": [
                          {
                            "expr": "self",
                            "star": true
                          }
                        ]
                      }
                    ]
                  }
                }
              ]
            },
            "text": "select * from `test`.`test_scope_1`.`test_collection_1` where Field_4 is not null;"
          }
        ]

      Logs are available at - 
      https://cb-engineering.s3.amazonaws.com/upgrade_from_7.0.3_to_7.0.4/collectinfo-2022-04-20T062423-ns_1%40172.23.136.107.zip
      https://cb-engineering.s3.amazonaws.com/upgrade_from_7.0.3_to_7.0.4/collectinfo-2022-04-20T062423-ns_1%40172.23.136.108.zip
      https://cb-engineering.s3.amazonaws.com/upgrade_from_7.0.3_to_7.0.4/collectinfo-2022-04-20T062423-ns_1%40172.23.136.109.zip
      https://cb-engineering.s3.amazonaws.com/upgrade_from_7.0.3_to_7.0.4/collectinfo-2022-04-20T062423-ns_1%40172.23.136.110.zip
      https://cb-engineering.s3.amazonaws.com/upgrade_from_7.0.3_to_7.0.4/collectinfo-2022-04-20T062423-ns_1%40172.23.136.111.zip
      https://cb-engineering.s3.amazonaws.com/upgrade_from_7.0.3_to_7.0.4/collectinfo-2022-04-20T062423-ns_1%40172.23.136.112.zip

      Attachments

        Issue Links

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

          Activity

            People

              amit.kulkarni Amit Kulkarni
              hemant.rajput Hemant Rajput
              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