opensearch-project / OpenSearch

🔎 Open source distributed and RESTful search engine.
https://opensearch.org/docs/latest/opensearch/index/
Apache License 2.0
9.7k stars 1.79k forks source link

[BUG] Rollovering aliases should support remote snapshot index #16419

Open kkewwei opened 4 days ago

kkewwei commented 4 days ago

Describe the bug

Same as #11226, we use alias to rollover the index, and restore the index as a searchable snapshot index, the restored searchable snapshot index is read-only, and share the same alias with the rollover index. But rollover operation will check the indices using the alias, and is blocked by METADATA_WRITE,

[FORBIDDEN/13/remote index is read-only];index [remote-index1-000006] blocked by: [FORBIDDEN/13/remote index is read-only];index [remote-index1-000001] blocked by: [FORBIDDEN/13/remote index is read-only];index [remote-index1-000002] blocked by: [FORBIDDEN/13/remote index is read-only];

Related component

Search:Searchable Snapshots

To Reproduce

  1. create index:

    PUT nginxlogs-000001/_settings
    {
    "index": {
        "blocks.read_only":"true"
    
    }
    }
  2. rollover POST nginxlogs/_rollover

  3. set the first index read-only

    PUT nginxlogs-000001/_settings
    {
    "index": {
        "blocks.read_only":"true"
    }
    }
  4. rollover and throw exception.

    
    POST nginxlogs/_rollover

index [nginxlogs-000001] blocked by: [FORBIDDEN/5/index read-only (api)]



### Expected behavior

rollover is ok

### Additional Details

**Plugins**
Please list all plugins currently enabled.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Host/Environment (please complete the following information):**
 - OS: [e.g. iOS]
 - Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
andrross commented 3 days ago

Thanks @kkewwei. This makes sense to me. Any interest in implementing this fix?