Build defered indexes list will stop if one is already built

server
query
n1ql

#1

Lets say I created multiple indexes with defer_build=true. Than I want to build them all using
BUILD INDEX ON myBucket (index1,index2,`…)

If one of the indexes is already built than the whole operation will stop and fail. And the rest of the indexes will not be built. I would expect that if one index is already build, just skip it and built the rest. Than return it in the response.


#2

@aterem, BUILD INDEX is a costly operation and once a build is in progress, the system doesn’t allow other indexes to be built for that bucket. So there is extra validation to make sure the admin is doing the right thing and help avoid wrong commands due to typo etc.


#3

@deepkaran.salooja, thanks for the reply.

I’m not talking about calling this command during an ongoing build. I’m taking about calling it when there is no build at that moment, but, it just so happens to be, that one of the indexes is already built, so we just need to built the other indexes that aren’t.

In today’s cloud environments, there is a minimal intervention from admin/system-eng. The build of the indexes and buckets are all created on an automatic deployment scripts. So it make sense to make this call for all needed indexes, assuming that if some of them are already there, they will just be skipped.


#4

@aterem, thanks for clarifying. This facility is going to be available in 5.0 Couchbase Server. The server will automatically filter out the indexes which are already built and build the remaining ones. You can try this out in CB 5.0 Beta.