Skip to content

[Bug] ApplicationBackUpCleanTask Runtime Error #4253

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Gianzie
Copy link
Contributor

@Gianzie Gianzie commented Jun 6, 2025

What changes were proposed in this pull request

In the current code, the table "t_flink_app_backup" will be cleaned at 01:00 everyday, and the sql is "SELECT id,app_id,sql_id,config_id,path,description,version,create_time FROM t_flink_app_backup GROUP BY app_id HAVING count(*) > 5"

But mysql8.0 sql_mode is "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION", so this clean task is always error.

So I think we can just get "FlinkApplicationBackup::getAppId" column.

Brief change log

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

Does this pull request potentially affect one of the following parts

  • Dependencies (does it add or upgrade a dependency): no

Copy link

sonarqubecloud bot commented Jun 6, 2025

@Gianzie
Copy link
Contributor Author

Gianzie commented Jun 6, 2025

error log:
Snipaste_2025-06-06_15-46-46

@GOODBOY008 GOODBOY008 self-requested a review June 6, 2025 09:02
Copy link
Member

@GOODBOY008 GOODBOY008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gianzie I left a comment.

Copy link
Member

@GOODBOY008 GOODBOY008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@

backUpService.lambdaQuery()
.select(FlinkApplicationBackup::getAppId)
.groupBy(FlinkApplicationBackup::getAppId)
.having("count(*) > " + maxBackupNum)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.having("count(*) > " + maxBackupNum)
.having("COUNT(*) > {0}", maxBackupNum)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gianzie Use params to pass value will be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants