How to cancel an index build

What is the correct way to cancel an index build that has not completed?

Hint: do not try to run a DROP INDEX statement with a N1QL query editor. This will cause the the node to become unresponsive.

1 Like

@daliba, DROP INDEX is the correct way of aborting the index build. I am assuming by “node” you mean the query editor became unresponsive as the drop index didn’t go through. If indexer is stuck(which may be the case as the build didn’t complete), then it can happen. We need to look into what is causing Indexer to be stuck.

Hey @deepkaran.salooja, thanks for the response.

So what should I expect when I run a DROP INDEX command? Should the index continue building? Or will it stop at some point?

What I experienced was actual server failure; that’s what I meant by node. When I connected to the CB console (using another server address, as all of the tabs become unresponsive on the server I was building the index on), and selected the Servers tab, I found a message on the index server saying “Node unresponsive. Not taking traffic. FAILOVER to activate available replicas.” It also showed CPU and Memory usage near 100%.

After restarting the server (from Azure, not CB console), the cancelled index would try to build, get to about 6% completed, and then revert to “warmup” in the Indexes > status column, and the start building again. Also, when the cancelled index showed a status of “warmup,” the other 2 indexes that exist on the same index server would also switch to “warmup.” This continued in a perpetual loop until the server went offline again (same message before with “Node unresponsive…”).

So, it does seem that the indexer can’t find its way out of the dark. What are my diagnostic tools for looking into why, and fixing the issue?

@daliba, the “warmup” status indicates the indexer crashed and is trying to recover. You can check the indexer.log under /opt/couchbase/var/lib/couchbase/logs to see why it is crashing.

Drop Index would delete the index completely. The index needs to be created again once drop is successful.