Deferred index building not idempotent
Description
Components
Affects versions
Fix versions
Environment
None
Release Notes Description
None
relates to
Activity
Show:

CB robot February 6, 2019 at 4:12 PM
Build couchbase-server-6.5.0-2250 contains indexing commit 2dbc385 with commit message:
https://couchbasecloud.atlassian.net/browse/MB-15784#icft=MB-15784: When executing build index command, skip indexes already built

Venkatraman Subramanian November 16, 2017 at 5:14 AM
@John Liang Ideally this should not happen if we are looking at sequencing the index DDLs.

Venkatraman Subramanian August 24, 2017 at 5:25 AM
Need to understand this in the context of supporting ALTER INDEX as well.

Cihan Biyikoglu September 23, 2015 at 7:45 PM
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 Krug July 22, 2015 at 4:40 PM
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?
Fixed
Pinned fields
Click on the next to a field label to start pinning.
Details
Details
Assignee

Reporter

Priority
Instabug
Open Instabug
PagerDuty
PagerDuty Incident
PagerDuty

PagerDuty Incident
Sentry
Linked Issues
Sentry
Linked Issues
Zendesk Support
Linked Tickets
Zendesk Support

Linked Tickets
Created July 21, 2015 at 9:29 PM
Updated January 21, 2020 at 3:10 PM
Resolved February 6, 2019 at 5:04 PM
Instabug
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--