Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Warn about the caveats with aliasing aliases #10106

Closed
colings86 opened this issue Mar 16, 2015 · 2 comments

Comments

Projects
None yet
5 participants
@colings86
Copy link
Member

commented Mar 16, 2015

Aliases are just tags on indices and not constructs in their own right. At the moment you can create an alias using aliases by doing the following:

curl -XPOST 'localhost:9200/_aliases' -d '{
    "actions" : [
        { "add" : { "index" : "2015-01-07", "alias" : "today" } }
        { "add" : { "index" : "2015-01-06", "alias" : "yesterday" } }
        { "add" : { "index" : "2015-01-05", "alias" : "3DaysAgo" } }
        { "add" : { "index" : "2015-01-04", "alias" : "4DaysAgo" } }
        { "add" : { "index" : "2015-01-03", "alias" : "5DaysAgo" } }
        { "add" : { "index" : "2015-01-02", "alias" : "6DaysAgo" } }
        { "add" : { "index" : "2015-01-01", "alias" : "7DaysAgo" } }
    ]
}'

curl -XPOST 'localhost:9200/_aliases' -d '{
    "actions" : [
        { "add" : { "index" : "today", "alias" : "thisWeek" } }
        { "add" : { "index" : "yesterday", "alias" : "thisWeek" } }
        { "add" : { "index" : "3DaysAgo", "alias" : "thisWeek" } }
        { "add" : { "index" : "4DaysAgo", "alias" : "thisWeek" } }
        { "add" : { "index" : "5DaysAgo", "alias" : "thisWeek" } }
        { "add" : { "index" : "6DaysAgo", "alias" : "thisWeek" } }
        { "add" : { "index" : "7DaysAgo", "alias" : "thisWeek" } }
    ]
}'

This makes it look like thisWeek points to today which points to 2015-01-07. What actually happens is that 2015-01-07 gets two aliases: today and thisWeek. This works absolutely fine but anyone using this method needs to be aware that if they update the today alias to point to 08-01-2015 it will not update the thisWeek alias and they will need to update that alias as well.

Is this something we should add to the documentation?

@javanna

This comment has been minimized.

Copy link
Member

commented Mar 17, 2015

yeah tricky bits @colings86 , least we can do is documenting this. I wonder if we should just prevent users from creating aliases against aliases till we properly support it as this seems like a trap.

@javanna

This comment has been minimized.

Copy link
Member

commented Jun 6, 2017

With #23977, in master we expand index expressions against indices only when managing aliases. I find that this is even better than updating our docs on the caveats of aliasing aliases, as that is not no longer allowed. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.