pinkfloyds commented on issue #16145:
URL:
https://github.com/apache/dolphinscheduler/issues/16145#issuecomment-2169694819
Plan One: Configure Workflow:
```sql
# black list
delete from t_ds_task_instance
where (project_code in ($project_code)
or process_instance_id in (select id
from t_ds_process_instance
where process_definition_code in
($process_definition_code)))
and start_time < NOW() - INTERVAL 3 MONTH;
# white list
delete from t_ds_task_instance
where (project_code not in ($project_code) or
process_instance_id not in (select id from t_ds_process_instance
where process_definition_code in
($process_definition_code)))
and start_time < NOW() - INTERVAL 3 MONTH;
```
Choose either a blacklist or a whitelist, retain data from the past three
months, modify as needed.fill in the corresponding parameters for $project_code
and $process_definition_code, and remove the corresponding conditions if they
are not needed, separated by English commas.
Set up an SQL node to implement the above functionality, the metadatabase
needs to be registered in the database center, and configure it to run as a
workflow on the 1st of every month, then export it as a JSON file for download
and use.
User documentation needs to be written for manual configuration, there are
many manual operations, if used improperly, unexpected situations may occur,
there is a slight threshold to use, and the development cycle is short
(basically developed).
Plan Two: Integration at the System Level:
Add an item "Log Cleaning Policy" to the menu, and implement the above
functionality on the interface, all users can use it directly, but the
development cycle is longer.
--
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]