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

Query returns wrong results in partition index and order by

    XMLWordPrintable

Details

    • Untriaged
    • Unknown

    Description

      USE 2 indexer nodes
      insert into default values("k01",{"fname":"xyz", "gender":"M", "lname":"abc","company":"pqr"});
      insert into default values("k02",{"fname":"xyz", "gender":"M", "lname":"abc","company":"pqr"});
      CREATE INDEX ix1 ON default (fname, gender, META().id, company, lname) PARTITION BY HASH(META().id);
      SELECT lname FROM default WHERE fname IS VALUED ORDER BY fname, gender, META().id;
       
      laname values returned is META().id
      

      Attachments

        Issue Links

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

          Activity

            Suggested testing for this bug. Most of these might already be covered in existing automation. 

            • Tests to focus on partitioned indexes. Thorough regression to be run on partitioned and non-partitioned indexes

            Primary index variations:

            • Non-Partitioned primary, with and without order by
            • Partitioned primary, with and without order by

            Secondary indexes:

            • Partitioned index with order by with nil projection as sent by N1QL. (Is it possible?)
            • Partitioned index with order by with non-nil projection as sent by N1QL.
            • Partitioned index with order by with non-nil projection, but nil EntryKeys in IndexProjection (Is it possible?)
            • Partitioned index with order by with non-nil projection, but empty EntryKeys in IndexProjection
            • Partitioned index with order by, full create index fields as EntryKeys (Project all). - Sub variations: PrimaryKey - True or False
            • Partitioned index with order by, leading subset of create index fields as EntryKeys. - Sub variations: PrimaryKey - True or False
            • Partitioned index with order by, non-leading subset of create index fields as EntryKeys. - Sub variations: PrimaryKey - True or False
            • Test partitioned indexes with order by with GROUPS and AGGRS having variations of projection EntryKeys
              Example:
              CREATE INDEX idx2 ON default(company, age, meta().id, `first-name`, `last-name`, docid) PARTITION BY HASH(META().id);
              SELECT company, age, meta().id, MAX(`first-name`), MIN(`last-name`) FROM default WHERE company > "A" GROUP BY company, age, meta().id ORDER BY company, age, meta().id
              Note -  "index_order" is seems to always bee subset of "index_projection" in above case with group by/aggrs. 

            Test all of the above variations with meta().id as one of the indexed fields and/or ORDER BY fields.
            Test all of the above variations with ASC and DESC fields in create and order by

            prathibha Prathibha Bisarahalli (Inactive) added a comment - Suggested testing for this bug. Most of these might already be covered in existing automation.  Tests to focus on partitioned indexes. Thorough regression to be run on partitioned and non-partitioned indexes Primary index variations: Non-Partitioned primary, with and without order by Partitioned primary, with and without order by Secondary indexes: Partitioned index with order by with nil projection as sent by N1QL. (Is it possible?) Partitioned index with order by with non-nil projection as sent by N1QL. Partitioned index with order by with non-nil projection, but nil EntryKeys in IndexProjection (Is it possible?) Partitioned index with order by with non-nil projection, but empty EntryKeys in IndexProjection Partitioned index with order by, full create index fields as EntryKeys (Project all). - Sub variations: PrimaryKey - True or False Partitioned index with order by, leading subset of create index fields as EntryKeys. - Sub variations: PrimaryKey - True or False Partitioned index with order by, non-leading subset of create index fields as EntryKeys. - Sub variations: PrimaryKey - True or False Test partitioned indexes with order by with GROUPS and AGGRS having variations of projection EntryKeys Example: CREATE INDEX idx2 ON default(company, age, meta().id, `first-name`, `last-name`, docid) PARTITION BY HASH(META().id); SELECT company, age, meta().id, MAX(`first-name`), MIN(`last-name`) FROM default WHERE company > "A" GROUP BY company, age, meta().id ORDER BY company, age, meta().id Note -  "index_order" is seems to always bee subset of "index_projection" in above case with group by/aggrs.  Test all of the above variations with meta().id as one of the indexed fields and/or ORDER BY fields. Test all of the above variations with ASC and DESC fields in create and order by
            ajay.bhullar Ajay Bhullar added a comment -

            Will close the bug once automation of mentioned test cases is done, for now the bug has been manually verified

            ajay.bhullar Ajay Bhullar added a comment - Will close the bug once automation of mentioned test cases is done, for now the bug has been manually verified

            Ajay Bhullar, I've assigned the bug to you for tracking the automation of scenario. Please assign it to concerned person, who is responsible for automating the scenario

            hemant.rajput Hemant Rajput added a comment - Ajay Bhullar , I've assigned the bug to you for tracking the automation of scenario. Please assign it to concerned person, who is responsible for automating the scenario

            Ajay Bhullar pls come up with a test plan with the additional scenarios mentioned here and get it reviewed by Prathibha before closing out the bug.

            mihir.kamdar Mihir Kamdar (Inactive) added a comment - Ajay Bhullar pls come up with a test plan with the additional scenarios mentioned here and get it reviewed by Prathibha before closing out the bug.

            The bug was already verified earlier

            mihir.kamdar Mihir Kamdar (Inactive) added a comment - The bug was already verified earlier

            People

              mihir.kamdar Mihir Kamdar (Inactive)
              deepkaran.salooja Deepkaran Salooja
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty