wangyang0918 commented on a change in pull request #12054:
URL: https://github.com/apache/flink/pull/12054#discussion_r442600774



##########
File path: 
flink-core/src/main/java/org/apache/flink/configuration/TaskManagerOptions.java
##########
@@ -257,6 +257,18 @@
                                        text("\"ip\" - uses host's ip address 
as binding address"))
                                .build());
 
+       /**
+        * The prefix of the TaskManager's ResourceID. If configured, the 
ResourceID will be generated with the prefix and a
+        * 6-character random string. Otherwise, a random string will be used. 
Only valid in standalone mode.
+        */
+       @Documentation.Section(Documentation.Sections.ALL_TASK_MANAGER)
+       public static final ConfigOption<String> 
TASK_MANAGER_RESOURCE_ID_PREFIX =
+               key("taskmanager.resource-id.prefix")
+                       .stringType()
+                       .noDefaultValue()
+                       .withDescription("The prefix of the TaskManager's 
ResourceID. If configured, the ResourceID will be generated with the prefix "
+                               + "and a 6-character random string. Otherwise, 
a random string will be used. Only valid in standalone mode.");

Review comment:
       Thanks for raising this valid concern. For standalone cluster, we could 
set different `TASK_MANAGER_RESOURCE_ID_PREFIX` per `TaskExecutor`. Currently, 
for active resourcemanager(Yarn, Mesos, K8s), we will generate a meaningful 
`ResourceID`(e.g. container id in Yarn, pod name in native K8s) per 
`TaskExecutor`. If we also want to respect the 
`TASK_MANAGER_RESOURCE_ID_PREFIX` config option, then it will be difficult to 
use the `ResourceID` to find the corresponding container/pod.
   
   Given that `TASK_MANAGER_RESOURCE_ID_PREFIX` is configured to 
"my-yarn-cluster-tm", then all the `TaskExecutor` share the same schema 
"my-yarn-cluster-tm-xxxxxx". A corresponding container id could be 
"container_e01_1592277741400_0043_01_000002". It is really confusing.
   
   If you just mean to override `TASK_MANAGER_RESOURCE_ID_PREFIX` option for 
active deployment with current meaningful name, i think it makes sense. We just 
use the config option to replace the environment to pass the `ResourceID` to 
`TaskExecutor`.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to