Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-34271

Fix the potential failure test about GroupAggregateRestoreTest#AGG_WITH_STATE_TTL_HINT

    XMLWordPrintableJSON

Details

    Description

      The underlying reason is that a previous PR introduced a test with state TTL as follows in the SQL: 

      .runSql(
              "INSERT INTO sink_t SELECT /*+ STATE_TTL('source_t' = '4d') */"
                      + "b, "
                      + "COUNT(*) AS cnt, "
                      + "AVG(a) FILTER (WHERE a > 1) AS avg_a, "
                      + "MIN(c) AS min_c "
                      + "FROM source_t GROUP BY b")

      When the savepoint metadata was generated for the first time, the metadata recorded the time when a certain key was accessed. If the test is rerun after the TTL has expired, the state of this key in the metadata will be cleared, resulting in an incorrect test outcome.

      To rectify this issue, I think the current tests in RestoreTestBase could be modified to regenerate a new savepoint metadata as needed every time. However, this seems to deviate from the original design purpose of RestoreTestBase.

      For my test, I will work around this by removing the data "consumedBeforeRestore", as I am only interested in testing the generation of an expected JSON plan.

      Attachments

        Issue Links

          Activity

            People

              xuyangzhong xuyang
              xuyangzhong xuyang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: