wjmmjr opened a new issue, #16008:
URL: https://github.com/apache/dolphinscheduler/issues/16008

   ### Search before asking
   
   - [X] I had searched in the 
[DSIP](https://github.com/apache/dolphinscheduler/issues/14102) and found no 
similar DSIP.
   
   
   ### Motivation
   
   When deploying the dolphinscheduler worker service in a k8s environment and 
mounting PVC, all files in the PVC have corresponding users. When the 
dolphinscheduler worker service restarts, the users in the container are 
cleared, and the users are recreated in order of connecting to the 
dolphinscheduler worker. At this time, the username and userid are not 
consistent with the situation before restarting. Due to the username and userid 
matching in the PVC file, the user corresponding to the PVC file is incorrect 
after restarting the container
   
   ### Design Detail
   
   Add tenantId to ProcessInstance.java and TaskExecutionContext.java
   Add method "createUser(int userId, String userName)" and 
"createUserIfAbsent(int userId, String userName)" and "createLinuxUser(int 
userId, String userName, String userGroup)" to OSUtils.java
   Modify method createTenant of TenantServiceImpl.java
   Modify method handleCommand of ProcessServiceImpl.java,add code 
"processInstance.setTenantId"
   Modify method buildProcessInstanceRelatedInfo of 
TaskExecutionContextBuilder.java,add code "taskExecutionContext.setTenantId"
   Modify method getOrCreateTenant of TaskExecutionContextUtils.java, add user 
by tenantId
   
   ### Compatibility, Deprecation, and Migration Plan
   
   _No response_
   
   ### Test Plan
   
   Run the dolphinscheduler worker service in the k8s environment and mount the 
shared PVC. Use different users to submit tasks, generate files in the PVC, and 
restart the dolphinscheduler worker service repeatedly. At this time, the user 
IDs in each worker are inconsistent
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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]

Reply via email to