Wrong Timezone in Painless Function

The government of our country recently canceled daylight saving time, and now functions using timezone return to America / Sao_Paulo the value -02 instead of -03, but if I test with America / Buenos_Aires, the value returned is the correct one , -03.

I am using this code to group documents by time:

"aggs":{
    "group":{
        "terms":{
            "script":{
                "inline":"Instant.ofEpochMilli(doc.datahora.date.millis).atZone(ZoneId.of(params.tz)).hour",
                "lang":"painless",
                "params":{
                    "tz":"America\/Sao_Paulo"
                }
            }
        }
    }
}

Is there anything I should update on my server?
The operating system is up to date, as are all packages.

Three question to help here:

  1. Can you tell us, when that change of cancelling DST happened?
  2. Which Elasticsearch version are you using?
  3. Which version of the JDK are you using?

The reason for this question is, that this kind of information is usually stored in something called a timezone database, which might not be up-to-date in older versions.

Thanks!

  1. Daylight Saving Time change occurred on 2019/07/01
  2. ElasticSearch Version: 6.8.4
  3. Java: 1.8.0_201 (even with apt upgrade it does not update to the latest available version)

so, the 6.8 dominantly uses joda time. Looking at https://github.com/elastic/elasticsearch/blob/v6.8.4/buildSrc/version.properties#L22 it seems that 6.8.4 was shipped with joda time 2.10.1 that was created in october 2018. However the timezone database was only updated in 2019 with the brazil change.

Would it be possible for you to test with a latest 7.4 release, as that one mainly uses java time.

I will check if it makes sense to update the 6.x branch with the latest joda release to include such changes.

I believe I fixed the server problem using the Timezone Updater Tool.