ArafatKhan2198 opened a new pull request, #7824:
URL: https://github.com/apache/ozone/pull/7824
## What changes were proposed in this pull request?
In the `FileSizeCountTask` class, the update logic in `writeCountsToDB()` is
never reached because `isDbTruncated` is always passed as true. This means that
records are always inserted without checking for existing records, leading to
SQL exceptions due to duplicate primary key constraints.
Example of SQL Exception:
```
2025-02-06 12:57:03 Caused by: org.jooq.exception.DataAccessException: SQL
[insert into "FILE_COUNT_BY_SIZE" ("volume", "bucket", "file_size", "count")
values (cast(? as varchar(32672)), cast(? as varchar(32672)), cast(? as
bigint), cast(? as bigint))]; The statement was aborted because it would have
caused a duplicate key value in a unique or primary key constraint or unique
index identified by 'pk_volume_bucket_file_size' defined on
'FILE_COUNT_BY_SIZE'.
```
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-12228
## How was this patch tested?
Existing UT ran successfully.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]