feat: add ownership to Task
Summary
- #15454
- assign a ownership to Task on CREATE TASK
- filter the task history by current effective roles
to query the task histories, we need ask cloudcontrol rpc service.
there're two possible ways:
maintain the ownership in the cloudcontrol rpc service while the ownership get changed
whenever
GRANT OWNERSHIPto another role in databend, we can also tell the change about task ownership cloudcontrol rpc service by a seperated rpc call likesalter_task_ownership()oralter_task().thus we can query the task history by passing the current effective roles on the rpc
get_task_histories.not maintain the ownership in the cloudcontrol service
on querying the task histories, databend-query can get ALL the task ids by its own metadata storage about ownerships, then it can pass a
task_idstoget_task_historiesto filter out the needed task histories.
Source: databendlabs/databend