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

Deferred index building not idempotent

    XMLWordPrintable

Details

    Description

      I've got some demo scripts that I'm using to create a bunch of deferred indexes and then build them. Running this on a clean system works well, but when I was diagnosing issues and running the script repeatedly, I found that if any indexes already exist in the build index statement, the others are not built.

      i.e.:
      CREATE INDEX def_sourceairport ON `travel-sample`(sourceairport) USING GSI WITH

      {"defer_build":true}

      CREATE INDEX def_name_type ON `travel-sample`(name) WHERE (_type = "User") USING GSI WITH

      {"defer_build":true}

      BUILD INDEX ON `travel-sample`(`def_sourceairport`, `def_name`) USING GSI"

      then
      DROP INDEX `travel-sample`.def_name

      then the same:
      CREATE INDEX def_sourceairport ON `travel-sample`(sourceairport) USING GSI WITH

      {"defer_build":true}

      CREATE INDEX def_name_type ON `travel-sample`(name) WHERE (_type = "User") USING GSI WITH

      {"defer_build":true}

      (fails understandably)
      BUILD INDEX ON `travel-sample`(`def_sourceairport`, `def_name`) USING GSI"
      -this fails saying that def_name is already built, but def_sourceairport does not get built either-

      Attachments

        Issue Links

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

          Activity

            Build couchbase-server-6.5.0-2250 contains indexing commit 2dbc385 with commit message:
            MB-15784: When executing build index command, skip indexes already built

            build-team Couchbase Build Team added a comment - Build couchbase-server-6.5.0-2250 contains indexing commit 2dbc385 with commit message: MB-15784 : When executing build index command, skip indexes already built

            John Liang Ideally this should not happen if we are looking at sequencing the index DDLs.

            venkatraman.subramanian Venkatraman Subramanian (Inactive) added a comment - John Liang Ideally this should not happen if we are looking at sequencing the index DDLs.

            Need to understand this in the context of supporting ALTER INDEX as well.

            venkatraman.subramanian Venkatraman Subramanian (Inactive) added a comment - Need to understand this in the context of supporting ALTER INDEX as well.

            I agree that we can queue index build requests and fire them off one at a time instead of returning errors. however this seem expensive so we need to push this to watson.next.

            cihan Cihan Biyikoglu (Inactive) added a comment - I agree that we can queue index build requests and fire them off one at a time instead of returning errors. however this seem expensive so we need to push this to watson.next.
            perry Perry Krug added a comment -

            Thanks Siri, perhaps idempotent is a much bigger ask. The main issue is to be able to have "build index" work even if there are some of those indexes built already. Is that easier to fix?

            perry Perry Krug added a comment - Thanks Siri, perhaps idempotent is a much bigger ask. The main issue is to be able to have "build index" work even if there are some of those indexes built already. Is that easier to fix?

            Perry, GSI commands are not idempotent in general. We can consider making them so, but I'll mark this as an enhancement for this reason.

            siri Sriram Melkote (Inactive) added a comment - Perry, GSI commands are not idempotent in general. We can consider making them so, but I'll mark this as an enhancement for this reason.

            People

              r.kalyanasundaram Ramalingam Kalyanasundaram [X] (Inactive)
              perry Perry Krug
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty