#15453·databend

feat: add ownership to Task

Author: flaneur2020Created May 9, 2024Updated Sep 15, 2026

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:

  1. maintain the ownership in the cloudcontrol rpc service while the ownership get changed

    whenever GRANT OWNERSHIP to another role in databend, we can also tell the change about task ownership cloudcontrol rpc service by a seperated rpc call likes alter_task_ownership() or alter_task().

    thus we can query the task history by passing the current effective roles on the rpc get_task_histories.

  2. 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_ids to get_task_histories to filter out the needed task histories.