Skip to content

[BUG] YYYY placeholder does not work correctly for last/first week of the year #16982

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

Closed
mousemaxx opened this issue Jan 9, 2025 · 2 comments
Labels
bug Something isn't working Other untriaged

Comments

@mousemaxx
Copy link

Describe the bug

The following index formation mask is used
"provided_name": "<indexname-{now/d{YYYY.MM.dd}}-002368>"
in the last week of 2024, the placeholder "YYYY" was replaced with 2025 instead of 2024.
Probably, the week number is used to obtain the year value. December 30 and 31, 2024 had week number 1 because the rest of the week was already in 2025.
image

Related component

Other

To Reproduce

1 Create new index
PUT /%3Cindex-%7Bnow%2Fd%7BYYYY.MM.dd%7D%7D-000001%3E
2 Create State Management policy with "rollover" and add this policy on index
3 Set system date and time on the last week of 2024 (or wait until the end of 2025 :) )
4 Rollover index and see name new index

Expected behavior

YYYY should be replaced this year

Additional Details

  • Version OpenSearch 2.18.0
@mousemaxx mousemaxx added bug Something isn't working untriaged labels Jan 9, 2025
@github-actions github-actions bot added the Other label Jan 9, 2025
@msfroh
Copy link
Collaborator

msfroh commented Jan 10, 2025

It looks like this changed as a result of the migration from Joda time to Java's built-in datetime formats. I found the relevant documentation for each:

On Joda, YYYY means "year of era (>=0)". In Java time, it means "week-based-year".

It looks like yyyy or uuuu should work, though.

@mousemaxx -- while it doesn't help with your indexes that rolled over recently, does that help for next year? Also, do you know if we have some bad documentation somewhere?

I'm going to close this issue as "by design", but if we're documenting the formats incorrectly somewhere, we should fix that.

@msfroh msfroh closed this as completed Jan 10, 2025
@mousemaxx
Copy link
Author

@msfroh, Thanks for the explanation. I'll fix all the templates. The current documentation is fine, my indexes are very old (more than 2 years). I don’t even remember where exactly I got such an index mask, it didn’t cause any problems before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Other untriaged
Projects
None yet
Development

No branches or pull requests

2 participants