apache / dolphinscheduler

Apache DolphinScheduler is the modern data orchestration platform. Agile to create high performance workflow with low-code
https://dolphinscheduler.apache.org/
Apache License 2.0
12.66k stars 4.57k forks source link

[BUG] After I delete Project or User #1279

Closed MiaoSO closed 3 years ago

MiaoSO commented 4 years ago

version: 1.1.0

  1. Delete Project 场景:普通用户,创建项目,工作流定义 创建工作流并保存 正常操作:普通用户或管理员用户,进入 项目管理 页,进行删除项目操作,提示 “please delete the process definitions in project first! ” 极端操作:使用超级管理员账户,进入 安全中心 页,选择 用户管理,删除该普通用户,提示 “Seccess”。会出现以下现象: 1.超级管理员账户,进入 项目管理 页,被删除用户所创建的项目不存在。 2.Mysql 数据库中,t_escheduler_project 表中,被删除用户所创建的项目存在。 3.使用任意账户,进入 项目管理 页,创建与被删除项目的同名项目,创建成功。 4.超级管理员账户,进入 安全中心 页,选择 用户管理,为用户授权项目时,会显示不存在于 项目管理 页但存在于 Mysql 表中的项目

  2. Delete User 场景:进行 删除用户 操作,会出现以下问题: 被删除用户 创建的所有资源 仍会在 HDFS 平台 和 Mysql 表中,且该用户的所有资源通过 UI 无法使用; 被删除用户 创建的项目也会被删除掉,管理员账户 查看 项目管理 会发现 已删除用户所创建的项目已不存在,但数据库中关于该用户所创建项目的数据并未被删除,若项目在删除用户操作之前被赋权给其他人,被删除的项目仍会在管理员对其他人的赋权中展示。

以下为自测恢复操作: Step 1:使用管理员账户,进入资源中心,删除属于 被删除用户 的所有资源 Step 2:删除该用户在 HDFS 平台上创建的资源 (若该用户有进行迁移租户操作,则需要删除旧租户下属于该用户的相关文件) Step 3:若 被删除用户 有创建项目,删除该用户在 Mysql 表 t_escheduler_project 中对应的数据(该用户创建的项目记录) Step 4:若 被删除用户 有创建项目,则,取消对 其他用户 的 属于该用户创建项目 的赋权(或删除 Mysql 表 t_escheduler_relation_project_user 相关数据) Step 5:若 被删除用户 有创建数据源,数据源会不可用,并提示“resource not exist”,删除该用户在 Mysql 表 t_escheduler_datasource 中对应的数据(该用户创建的数据源记录) Step 6:若 被删除用户 有被赋权项目,且在被赋权的项目中,有创建 工作流定义,会出现被删除用户创建的工作流定义不可用,需要修改 Mysql 表 “t_escheduler_process_definition” 中,相关工作流的 “user_id” 为有该项目权限的用户ID或管理员用户ID

MiaoSO commented 4 years ago

以下为本人参照 DolphinScheduler 官网及 https://blog.csdn.net/github_39577257/article/details/102783298 在搭建、测试过程中整理的文档。 包含架构、搭建、以及本人测试过程中的一些疑问,烦请不吝赐教https://blog.csdn.net/MiaoSO/article/details/103137481

MiaoSO commented 4 years ago

(1). Delete the Project Premise: Ordinary user, create project, create workflow and save Normal operation: Normal user or administrator user, enter "Project", delete the project operation, prompt "please delete the process definitions in project first! " Extreme operation: Use the administrator account, enter "Security -> User Manage", delete the ordinary user, prompt "Seccess". The following phenomena may occur:

  1. Super administrator account, enter project management page, and the project created by the deleted user does not exist.
  2. In the Mysql database, in the t_escheduler_project table, the deleted project created by the user exists.
  3. Enter the project management page with any account, create the project with the same name as the deleted project, and create it successfully.
  4. Super administrator account, enter "Security -> User Manage", when authorizing the project for the user, it will show the project that does not exist in the project management page but exists in the Mysql table

(2). Delete the User Premise: delete the user and the following problems will occur: 1.All resources created by the deleted user will still be in the HDFS platform and Mysql table, and all resources of the user cannot be used through the UI. 2.Project created by deleted users will also be removed, the administrator account to check the project management will find the project which created the user does not exist, but in Mysql table the project still exist. If the project had been empowerment to others before delete user action, the deleted items will still be shown in "Security -> User Manage -> Grant authority -> Project "

The following is the self-test recovery operation: Step 1: use the administrator account to enter the "Resources" and delete all resources belonging to the deleted user Step 2: delete the resources created by the user on the HDFS platform (if the user has a tenant migration operation, delete the files belonging to the user under the old tenant) Step 3: if the deleted user has created an item, delete the data corresponding to the user in the Mysql table t_escheduler_project (the project record created by the user). Step 4: if the deleted user has created a project, then cancel the assignment of other users belonging to the project created by the user (or delete Mysql table t_escheduler_relation_project_user related data). Step 5: if the deleted user has created a datasource, the datasource will be unavailable, and the prompt "resource not exist" will be prompted. Delete the data corresponding to the user in the Mysql table t_escheduler_datasource (the record of the datasource created by the user). Step 6: If the deleted user has an item that is authorized, and in the item that is authorized, a workflow definition has been created. It will appear that, the workflow definition created by the deleted user will be unavailable. It is necessary to change the Mysql table "t_escheduler_process_definition". The "user_id" of the related workflow is the user ID or administrator user ID that has permissions for the project.

davidzollo commented 3 years ago

1.1.0 is not apache version, and has been passed a long time, you can use 1.3.3 if you are interesting in DolphinScheduler