N1QL GSI disappeared unexpectedly

Hi,
I am using Couchbase 4.1 cluster(3 nodes contained) as a document database. Therefore, I created a global secondary index in each node to speed up our queries. However, this index often disappeared unexpectedly.
The statements are as follows:
> CREATE INDEX fundcode_71_idx ON fsp-dsbkt (fund_code) USING GSI WITH{“nodes”:“xx.xx.34.71:8091”}
> CREATE INDEX fundcode_72_idx ON fsp-dsbkt (fund_code) USING GSI WITH{“nodes”:“xx.xx.34.72:8091”}
> CREATE INDEX fundcode_73_idx ON fsp-dsbkt (fund_code) USING GSI WITH{“nodes”:“xx.xx.34.73:8091”}

And I can not find any useful info in the indexer.log.

Has anyone met the similar problem?
How to locate the reason?

@hackergodness, can you provide some more details:

  1. After your created the indexes, did the indexes get built successfully? You can check the status both on the UI and on the cbq shell using “select * from system:indexes”.

  2. When you say “disappeared”, do you mean you cannot see those on the UI or cbq shell or both?

@deepkaran.salooja Thanks for your reply.
A1. I just recreated the index today. The state shows online from the cbq shell query result.

     {
        "indexes": {
            "datastore_id": "http://127.0.0.1:8091",
            "id": "2277aa01bf3bf0b3",
            "index_key": [
                "`fund_code`"
            ],
            "keyspace_id": "ypd-fsp-dsbkt",
            "name": "fundcode_73_idx",
            "namespace_id": "default",
            "state": "online",
            "using": "gsi"
        }
    },
    {
        "indexes": {
            "datastore_id": "http://127.0.0.1:8091",
            "id": "3f4676b3920e3959",
            "index_key": [
                "`fund_code`"
            ],
            "keyspace_id": "ypd-fsp-dsbkt",
            "name": "fundcode_72_idx",
            "namespace_id": "default",
            "state": "online",
            "using": "gsi"
        }
    },
    {
        "indexes": {
            "datastore_id": "http://127.0.0.1:8091",
            "id": "949960b75efb9d87",
            "index_key": [
                "`fund_code`"
            ],
            "keyspace_id": "ypd-fsp-dsbkt",
            "name": "fundcode_71_idx",
            "namespace_id": "default",
            "state": "online",
            "using": "gsi"
        }
    }

This is what I saw from the web console.

A2. Both of them cannot find the indexes. I can only to recreate them.

We did not drop the indexes manually.
Is there any other operation being done to drop the indexes?

@hackergodness, if you delete a bucket, indexes for that bucket are automatically deleted. Did you happen to delete the bucket? Other than that there is no automatic cleanup.

@deepkaran.salooja, I just fond something from the indexer.log file.
Name: fundcode_71_idx Bucket: ypd-fsp-dsbkt State: INDEX_STATE_DELETED Stream: MAINT_STREAM
2017-08-02T18:50:21.133+08:00 [Info] MutationMgr::handleRemoveIndexListFromStream
Message: MsgStreamUpdate
Type: REMOVE_INDEX_LIST_FROM_STREAM
Stream: MAINT_STREAM
Bucket:
BuildTS: []
IndexList: [
InstId: 10707695929738894727
Defn: DefnId: 10707695929738894727 Name: fundcode_71_idx Using: forestdb Bucket: ypd-fsp-dsbkt IsPrimary: false
SecExprs: [fund_code]
PartitionScheme: SINGLE PartitionKey: WhereExpr:
State: INDEX_STATE_DELETED
Stream: MAINT_STREAM
PartitionContainer: &{map[1:{1 [:9105]}] 1}]
RestartTs:
2017-08-02T18:50:21.14+08:00 [Info] Timekeeper::handleRemoveIndexFromStream
Message: MsgStreamUpdate
Type: REMOVE_INDEX_LIST_FROM_STREAM
Stream: MAINT_STREAM
Bucket:
BuildTS: []
IndexList: [
InstId: 10707695929738894727
Defn: DefnId: 10707695929738894727 Name: fundcode_71_idx Using: forestdb Bucket: ypd-fsp-dsbkt IsPrimary: false
SecExprs: [fund_code]
PartitionScheme: SINGLE PartitionKey: WhereExpr:
State: INDEX_STATE_DELETED
Stream: MAINT_STREAM
PartitionContainer: &{map[1:{1 [:9105]}] 1}]
RestartTs:

Why was the state of this index marked as INDEX_STATE_DELETED instead of INDEX_STATE_ACTIVE?

@hackergodness, you can look further up in the log file to find the reason for DELETED state. The state change to INDEX_STATE_DELETED is done either in case of explicit Drop index command or if the bucket gets deleted.