Skip to content

Migrate elasticsearch client to 8.* (or latest 7.*) #31256

Closed

Description

@potiuk

Body

The eleasticsearch version we use is old (from 2021). It is eleasticsearch 7.* and since we are using elasticsearch-dsl, we cannot used elasticsearch 8 currently (first version of that was also released in 2021).

We are currently limited to < 7.15.0 additionally to being limited to 7, because 7.15.0 breaks our tests as we found out when we released some of the dependencies as part of #30067

We should migrate to a newer version of elasticsearch. There are two options:

  1. Fix the tests and migrate to lates 7.* version - and bump to latest released 7* by fixing our tests (possible for short term).
  2. Migreate to 8 version (better long term)

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Activity

  1. added
    kind:metaHigh-level information important to the community
    on May 12, 2023
  2. changed the title [-]Migrate elasticsearch to 8[/-] [+]Migrate elasticsearch client to 8.* (or latest 7.*)[/+] on May 12, 2023
  3. Owen-CH-Leung commented on May 25, 2023

    @Owen-CH-Leung
    Contributor

    Since elasticsearch-dsl doesn't support elasticsearch 8, if we are to migrate to the official elasticsearch 8, does it mean we need to deprecate elasticsearch-dsl also ?

  4. potiuk commented on May 26, 2023

    @potiuk
    MemberAuthor

    If we do yes. But that also might be reason why we don't do it.

  5. Owen-CH-Leung commented on May 27, 2023

    @Owen-CH-Leung
    Contributor

    Ok. Please assign this issue to me. I'll take some time to study the current usage of this package and propose whether to upgrade to 8.* or latest 7.*

  6. potiuk commented on May 27, 2023

    @potiuk
    MemberAuthor

    Done.

  7. Owen-CH-Leung commented on May 29, 2023

    @Owen-CH-Leung
    Contributor

    I saw elasticsearch_dsl was only used in 3 files as follows (one usage in taskhandler & 2 in testing) :

    Search(index=self.index_patterns, using=self.client)

    "elasticsearch": ["elasticsearch", "es.elastic", "elasticsearch_dsl"],

    with mock.patch("elasticsearch_dsl.Search.execute") as mock_execute:

    Given the utilization of elasticsearch_dsl is fairly limited, I'll try to upgrade to elasticsearch 8.* and deprecate elasticsearch_dsl

  8. Owen-CH-Leung commented on May 29, 2023

    @Owen-CH-Leung
    Contributor
  9. Owen-CH-Leung commented on May 29, 2023

    @Owen-CH-Leung
    Contributor

    I feel like if we are to upgrade to elasticsearch 8, we need to divide it into chunk of works (coz we will be deprecating 2 packages). Since elasticsearch-dbapi is used to construct the ElasticsearchSQLHook, we might first need to refactor it using the existing official elasticsearch library. Then we can go further to refactor the taskhandler that uses elasticsearch_dsl to use the existing elasticsearch library. Finally we can attempt to upgrade to 8, remove those 2 libraries, and fix the failing tests. What do you think ? @potiuk

  10. potiuk commented on Jun 8, 2023

    @potiuk
    MemberAuthor

    sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions