justinmclean opened a new issue, #10600:
URL: https://github.com/apache/gravitino/issues/10600
### What would you like to be improved?
In PostgreSQL,
ModelVersionMetaPostgreSQLProvider.deleteModelVersionMetasByLegacyTimeline(...)
deletes from model_version_info but selects id values from model_meta.
Current SQL shape:
```
DELETE FROM model_version_info
WHERE id IN (
SELECT id FROM model_meta
WHERE deleted_at > 0 AND deleted_at < #{legacyTimeline}
LIMIT #{limit}
)
```
This is inconsistent with the base implementation and with similar
PostgreSQL providers, which select IDs from the same table they delete from. As
a result, the garbage-collection path for MODEL_VERSION can delete the wrong
rows or miss rows that should be purged.
### How should we improve?
Update the PostgreSQL override to select IDs from model_version_info instead
of model_meta, matching the existing provider pattern used elsewhere. For
example:
```
DELETE FROM model_version_info
WHERE id IN (
SELECT id FROM model_version_info
WHERE deleted_at > 0 AND deleted_at < #{legacyTimeline}
LIMIT #{limit}
)
```
--
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]