-
Notifications
You must be signed in to change notification settings - Fork 24.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
XPack: core/ccr/Security-cli migration to java-time #38415
XPack: core/ccr/Security-cli migration to java-time #38415
Conversation
migraiton of joda-time to java-time
Pinging @elastic/es-core-infra |
@@ -29,7 +29,8 @@ | |||
public class ScheduledEventTests extends AbstractSerializingTestCase<ScheduledEvent> { | |||
|
|||
public static ScheduledEvent createScheduledEvent(String calendarId) { | |||
ZonedDateTime start = ZonedDateTime.ofInstant(Instant.ofEpochMilli(new DateTime(randomDateTimeZone()).getMillis()), ZoneOffset.UTC); | |||
long millis = Clock.system(randomZone()).millis();// TODO we are converting to UTC anyway?? | |||
ZonedDateTime start = Instant.ofEpochMilli(millis).atZone(ZoneOffset.UTC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure we need to do soo many convertions here. maybe using just 'ZonedDateTime.now(UTC)` ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack. can you check why we need random timezone here at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left few comments to be sure this works. especially when in 'mixed mode' during rolling upgrades (I do not know if anything gets serialized over the write, but it might be worth checking)
@@ -220,7 +220,7 @@ | |||
rolledDateHisto.interval(source.interval()); | |||
} | |||
|
|||
String timezone = source.timeZone() == null ? DateTimeZone.UTC.toString() : source.timeZone().toString(); | |||
String timezone = source.timeZone() == null ? ZoneOffset.UTC.toString() : source.timeZone().toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this get serialized over the wire somewhere? If so we may need to convert it using DateUtils
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is read in ValuesSourceAggregationBuilder
so I guess it is already taken care of?
with
if (in.getVersion().before(Version.V_7_0_0)) {
timeZone = DateUtils.dateTimeZoneToZoneId(in.readOptionalTimeZone());
} else {
timeZone = in.readOptionalZoneId();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
@@ -288,7 +288,7 @@ static QueryBuilder rewriteQuery(QueryBuilder builder, Set<RollupJobCaps> jobCap | |||
String fieldName = range.fieldName(); | |||
// Many range queries don't include the timezone because the default is UTC, but the query | |||
// builder will return null so we need to set it here | |||
String timeZone = range.timeZone() == null ? DateTimeZone.UTC.toString() : range.timeZone(); | |||
String timeZone = range.timeZone() == null ? ZoneOffset.UTC.toString() : range.timeZone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is read from RangeQueryBuilder
does not seem to be using DateUtils
timeZone = in.readOptionalZoneId();
do you think that should be fixed in server?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please open an issue for that, so we do not forget about it
@@ -29,7 +29,8 @@ | |||
public class ScheduledEventTests extends AbstractSerializingTestCase<ScheduledEvent> { | |||
|
|||
public static ScheduledEvent createScheduledEvent(String calendarId) { | |||
ZonedDateTime start = ZonedDateTime.ofInstant(Instant.ofEpochMilli(new DateTime(randomDateTimeZone()).getMillis()), ZoneOffset.UTC); | |||
long millis = Clock.system(randomZone()).millis();// TODO we are converting to UTC anyway?? | |||
ZonedDateTime start = Instant.ofEpochMilli(millis).atZone(ZoneOffset.UTC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack. can you check why we need random timezone here at all?
Looks good for the ML changes. |
this is failing the build because of change in |
@elasticmachine run elasticsearch-ci/1 |
Re: the rollup bits, I've updated #36237 and will try to get it merged soon |
The clock resolution changed from jdk8 to jdk10, hence the test is passing in jdk8 but failing in jdk10. Scheduled events are serialised and deserialised with millisecond precision, making test fail in jdk 10 and higher. Fixes a problem introduced by elastic#38415 and the fix is identical to the one that was made in elastic#38405.
The clock resolution changed from jdk8 to jdk10, hence the test is passing in jdk8 but failing in jdk10. Scheduled events are serialised and deserialised with millisecond precision, making test fail in jdk 10 and higher. Fixes a problem introduced by #38415 and the fix is identical to the one that was made in #38405.
) The clock resolution changed from jdk8 to jdk10, hence the test is passing in jdk8 but failing in jdk10. Scheduled events are serialised and deserialised with millisecond precision, making test fail in jdk 10 and higher. Fixes a problem introduced by elastic#38415 and the fix is identical to the one that was made in elastic#38405.
) The clock resolution changed from jdk8 to jdk10, hence the test is passing in jdk8 but failing in jdk10. Scheduled events are serialised and deserialised with millisecond precision, making test fail in jdk 10 and higher. Fixes a problem introduced by elastic#38415 and the fix is identical to the one that was made in elastic#38405.
) The clock resolution changed from jdk8 to jdk10, hence the test is passing in jdk8 but failing in jdk10. Scheduled events are serialised and deserialised with millisecond precision, making test fail in jdk 10 and higher. Fixes a problem introduced by elastic#38415 and the fix is identical to the one that was made in elastic#38405.
The clock resolution changed from jdk8 to jdk10, hence the test is passing in jdk8 but failing in jdk10. Scheduled events are serialised and deserialised with millisecond precision, making test fail in jdk 10 and higher. Fixes a problem introduced by #38415 and the fix is identical to the one that was made in #38405. Backport of #38506
* master: Add an authentication cache for API keys (elastic#38469) Fix exit code in certutil packaging test (elastic#38393) Enable logs for intermittent test failure (elastic#38426) Disable BWC to backport recovering retention leases (elastic#38477) Enable bwc tests now that elastic#38443 is backported. (elastic#38462) Fix Master Failover and DataNode Leave Blocking Snapshot (elastic#38460) Recover retention leases during peer recovery (elastic#38435) Set update mappings mater node timeout to 30 min (elastic#38439) Assert job is not null in FullClusterRestartIT (elastic#38218) Update ilm-api.asciidoc, point to REMOVE policy (elastic#38235) (elastic#38463) SQL: Fix esType for DATETIME/DATE and INTERVALS (elastic#38179) Handle deprecation header-AbstractUpgradeTestCase (elastic#38396) XPack: core/ccr/Security-cli migration to java-time (elastic#38415) Disable bwc tests for elastic#38443 (elastic#38456) Bubble-up exceptions from scheduler (elastic#38317) Re-enable TasksClientDocumentationIT.testCancelTasks (elastic#38234) Allow custom authorization with an authorization engine (elastic#38358) CRUDDocumentationIT fix documentation references Remove support for internal versioning for concurrency control (elastic#38254)
part of the migrating joda time work.
refactoring x-pack plugins usages of joda to java-time
refers #27330