There is an error related to index

I am using Couchbase version: 4.1.0-5005 Enterprise Edition (build-5005).
I tried to create primary index on 30 billions of documents but it failed by consuming
the full of disk space. There is an error as follows:

I tried to drop the primary index but it shows another error.

cbq> DROP PRIMARY INDEX ON default USING GSI;
{
“requestID”: “aa09b735-d7d9-468e-8c3d-0258ca76ab53”,
“errors”: [
{
“code”: 5000,
“msg”: “GSI index #primary not found.”
}
],
“status”: “fatal”,
“metrics”: {
“elapsedTime”: “27.894833ms”,
“executionTime”: “23.230885ms”,
“resultCount”: 0,
“resultSize”: 0,
“errorCount”: 1
}
}

It looks the index is weird. How can solve this problem ?

DROP PRIMARY INDEX ON #primary USING GSI

Try it

I tried but it caused another error.

cbq> DROP PRIMARY INDEX ON #primary USING GSI ;
{
“requestID”: “5c244a9f-95b1-4ba7-a65b-473e181ad782”,
“errors”: [
{
“code”: 3000,
“msg”: “syntax error - at primary”
}
],
“status”: “fatal”,
“metrics”: {
“elapsedTime”: “618.694µs”,
“executionTime”: “574.409µs”,
“resultCount”: 0,
“resultSize”: 0,
“errorCount”: 1
}
}

I’ve deleted the default bucket.

But the primary index looks exists.

Then in the process of developing primary index. You write your query should work. Couchbase to restart services or reboot the machine. because it can be hung in the index in the formation of the new start time will be reduced.

I found the filesystem for index is full on a node.

root@cb-az-1a-1:/var/couchbase/index/@2i# df .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/Volume01-LogVol01 1031992064 979546876 4 100% /var/couchbase/index
root@cb-az-1a-1:/var/couchbase/index/@2i# ls -lR
.:
total 572
drwxrwx— 2 couchbase couchbase 4096 May 18 19:44 default_#primary_2808768322146682171_0.index
-rw-rw---- 1 couchbase couchbase 581632 May 19 14:59 MetadataStore

./default_#primary_2808768322146682171_0.index:
total 979473236
-rw-rw---- 1 couchbase couchbase 997755080704 May 19 14:28 data.fdb.2
-rw-rw---- 1 couchbase couchbase 7647457280 May 18 20:13 data.fdb.3

Should I extend the size of the filesystem ?

I extended the size of the filesystem. Then the index related error has disappeared. However
I couldn’t remove the index.

cbq> DROP PRIMARY INDEX ON default USING GSI;
{
“requestID”: “3272889e-7bd0-4438-99c4-46f040893b91”,
“signature”: null,
“results”: [
],
“errors”: [
{
“code”: 5000,
“msg”: “GSI Drop() - cause: Request Timeout”
}
],
“status”: “errors”,
“metrics”: {
“elapsedTime”: “2m1.059419387s”,
“executionTime”: “2m1.059351767s”,
“resultCount”: 0,
“resultSize”: 0,
“errorCount”: 1
}
}

cbq> create primary index on default;
{
“requestID”: “a12f56c7-9aca-47fe-a212-6734c866b573”,
“signature”: null,
“results”: [
],
“errors”: [
{
“code”: 5000,
“msg”: “GSI CreatePrimaryIndex() - cause: Index #primary already exist.”
}
],
“status”: “errors”,
“metrics”: {
“elapsedTime”: “769.089µs”,
“executionTime”: “720.573µs”,
“resultCount”: 0,
“resultSize”: 0,
“errorCount”: 1
}
}

Same issue here on Version: 4.1.0-5005 Community Edition (build-5005),

created primary index on a bucket, creation failed due to missing indexer port configuration on 9999, now the index is visible in the web console:

and it is impossible to remove it in cbq:

cbq> DROP PRIMARY INDEX ON `Data`;
{
    "requestID": "1318b3c0-878d-4897-949c-5629684a78c0",
    "errors": [
        {
            "code": 5000,
            "msg": "GSI index #primary not found."
        }
    ],
    "status": "fatal",
    "metrics": {
        "elapsedTime": "56.467313ms",
        "executionTime": "56.378813ms",
        "resultCount": 0,
        "resultSize": 0,
        "errorCount": 1
    }
}

it is also not visible with the command:

SELECT * FROM system:indexes;

but other indexes are visible, as well as the another primary index that I created on the same bucket after my 9999 port issue:

Is there a way to delete this ghost #primary index ?