-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BUG] DATETIME_FORMATTER_CACHING_SETTING experimental feature should not default to true #13411
Comments
Tagging folks who worked on original PR: @reta @CaptainDredge @ankitkala It seems like this PR has been backported all the way to 2.11 which makes me think this isn't really an experimental feature flag anymore, which in that case we should move this to a dynamic setting. |
Thanks a lot @jed326 for bringing this one up, I think yes, we messed it up with default I believe, it indeed should be set as AFAIK we cannot make it dynamic setting - the formatters are static instances that are created with the caching turned on/off, probably we could make it work generally speaking it but it would need redesign, 💯 |
Thanks @reta -- do you think a static setting would make sense here then? I know we have a 2.14 release coming up soon but too, do you see this as a release blocker for that? |
I mean there is no access to any kind of settings when the formatters are initialized. Reverting the default to |
@reta this would then result in a change of default format in the new version. How about we take the feature out of experimental setting? I feel like since this was enabled by default, sufficient bake time has been provided for any issue to bubble up. Wdyt? |
@CaptainDredge Hm .. why would default format change? this is for caching only, right?
The takeaway from this issue is that it is turned off by some users, we cannot make it non-experimental without clearing the behaviour first. |
@reta This does change the default format: OpenSearch/server/src/main/java/org/opensearch/index/mapper/DateFieldMapper.java Lines 105 to 109 in 0ddbd96
I do think what @CaptainDredge suggested in moving this out of experimental is where we eventually want to end up. It seems like the main sentiment in the forum post that reported this is that there's uncertainty in what will be default going forward since this is currently under experimental. |
Ah yeah, thanks @jed326 , even the setting is somewhat confusing than, I think @CaptainDredge suggesting would make sense |
@jed326 @CaptainDredge The forum post says "...was enabled by default and broke some functionality in our applications". Have we dug into that? We should seriously consider reverting the default behavior back to the pre 2.11 format since we've got at least one data point that this is a breaking change. |
Thanks @andrross , I missed the "broke" part but it should be included into this issue in bold, I suspect the default format change could be the culprit here (caching is less likely but possible). |
I've asked the original poster on the forum for some more details on what specifically broke for them |
Definitely! Ideally the behaviour should've remained same since the new default format is just an extension of old default format. I'm highly curious to know what broke for the user in order to understand the functional difference between the old and new format |
Hey all, yeah the error we were seeing after upgrading to OpenSearch 2.12 was:
Guess this was because in several instances a type mismatch between how we were formatting our dates, and the default change in the new OpenSearch. Everything was working again as expected when we disabled the default format change with the experimental flag. As @jed326 mentioned above, main motivation for forum post was to see whether this would be default in future, and to bring up the oddity that an 'experimental' feature was enabled by default. Also, took a little bit of time to properly figure out this change too, as nothing to do with the default datetime format changing was mentioned in the release note that I could see. Cheers for raising this issue and the discussion around it! :) |
Thanks @StewartWBrown1 , @andrross @jed326 @CaptainDredge I strongly feel like we have to step back and follow the proper rollout process:
I don't think this change would have any impact on existing apps (if the switch between default date formatters was not noticeable, it still won't be noticeable either). But it would address user's concern, the evidence we've been looking for to confirm that things do break. |
@reta Agree, I think we should change the default back to the pre-2.11 behavior since we know this change was breaking for at least one user. I suspect more people (who have yet to upgrade to 2.11+) will be impacted if we don't fix this ASAP. |
Thanks @andrross , I think we could make it to |
@jed326 @CaptainDredge what do you think? |
I also agree that changing back to |
I agree that this is a miss for default. I believe the indexing would have still gone through for these use cases.
[Keeping the issue closed but would like to understand the scenario more] |
Reopening this since I've not seen any traction. @reta @StewartWBrown1 I'm still not sure of the actual issue here. Could you please help understand this? |
@mgodwan please check #13411 (comment) |
@reta I've gone through the issue and comments, but have not been able to figure out what exactly broke with the change. The new default format is compatible with the legacy one if I understand correctly |
@mgodwan as user reported, this is not about functional format compatibility, but format of the datetime field:
I don't know exact use case but I could imaging one, when the existing mappings for the index were created with the "old" default but than when the "new" default kicks in, it triggers an attempt to update the existing mapping (please notice, no changes on user side). |
In case of default format, mapping format is not persisted ever. e.g.
Till 2.11, the above would've passed. Starting 2.12, user would've seen the error reported above. I don't think that this accounts for breaking change (as ideally, we should not even allow setting an explicit format when default is used but sadly opensearch had been allowing this). |
Thanks, this is clear now.
This is 100% breaking change for user: the feature that was worked before is not anymore (without any changes from user side).
Since the default could change (which we sadly did), why we should not even allow setting an explicit format? |
@mgodwan In the documentation itself, OpenSearch states:
In this instance, upstream/downstream components were affected by an API change due to the new default datetime setting, and therefore in my view this can be considered a breaking change. The Upgrade docs also state that 'breaking changes are only introduced between major version releases.' and this was a minor version bump from 2.11.0 -> 2.12.0 My original forum post was to point out this change did break us & wasn't documented in the upgrade notes, but also to point out this change occurred through a new setting tagged as 'experimental' which the documentation also says should be 'false' by default. With both these things in mind, I agree with the discussion on this ticket and think it should be 'false' by default. |
@reta In general, we don't allow mappings for a field to be modified (e.g. doc_values cannot be enabled for a field for which it has been disabled). Similar to that, we don't allow date_time format to be changed once set (e.g. you cannot change from epoch_millis to strict_data_time_no_millis) . Only in case of default, users can set it explicitly equal to the backing default (and not to any other format) which is the payload which broke. |
@StewartWBrown1 Yes, the change can be considered breaking in line with the semantic versioning guidelines followed for OpenSearch project and I'm ok keeping it false. Could you help me understand the use-case due to which you need to set the format explicitly here and could not rely on the new backing default? I don't think indexing would have broken as the new default format is backward compatible. I'm thinking we should not allow updating format in any case today and would like to open another discussion on the path to make the new experimental default format generally available without a feature flag.
The documentation was updated here https://opensearch.org/docs/latest/field-types/supported-field-types/date/#default-format . I'm unsure why it never made to release notes. |
@mgodwan My understanding from your comment #13411 (comment) the mapping was not modified but created the first time (and it worked before change and not after)? Modification restrictions are not specific to date format, as you mentioned |
@reta No, you can successfully create the index. Its only when attempting to modifying the mappings that this error will come, which is the same behaviour as before based on how we look at it (i.e. changing from something other than default is not allowed) Let me know your thoughts.
|
Thanks @mgodwan , so it is exactly the flow I suspected (#13411 (comment)). In any case, I strongly lean towards classifying this change as a breaking: we do allow "noop" mapping updates but the change of the default date format broke that. |
Just to clarify on the part (I honestly don't see a use case for performing this action but I agree that this may not be in line with semantic versioning guidelines and hence may justify the revert. I've asked the original reporter about the use case as well so that it gives us a path to solve for the issue and decide if we can disable no-op format modifications for the user as it is kind of leaking an implementation detail through the API)
|
I think we have to fix this feature rollout by introducing 2 separate feature flags (I think @CaptainDredge mentioned that as well at some point):
|
@mgodwan I am closing this issue as per resolution, |
Describe the bug
This was first reported on the opensearch forum: https://forum.opensearch.org/t/opensearch-experimental-setting-true-by-default-datetime-formatter-caching/19067
The experimental feature flag
opensearch.experimental.optimization.datetime_formatter_caching.enabled
defaults to true, see:OpenSearch/server/src/main/java/org/opensearch/common/util/FeatureFlags.java
Lines 82 to 86 in 81707dc
We clearly state in our release notes that experimental feature flags are disabled by default: https://github.com/opensearch-project/opensearch-build/blob/a7f6bb5901545875d7817f26016a1d6c99c4d8ad/release-notes/opensearch-release-notes-2.12.0.md?plain=1#L24
This was introduced in #9567
Related component
Indexing
To Reproduce
See code block linked in description.
Expected behavior
All experimental feature flags should be disabled by default. Ideally this should be enforced in the code as well.
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):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: