From 3199925e1333eba20fca9d15e5c902200facdc33 Mon Sep 17 00:00:00 2001 From: Hu# Date: Mon, 13 Nov 2023 15:54:44 +0800 Subject: [PATCH] playground/log: add mcs name for pd log (#2310) --- components/playground/instance/pd.go | 2 +- components/playground/playground.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/playground/instance/pd.go b/components/playground/instance/pd.go index 68673d55fe..5d9a549cac 100644 --- a/components/playground/instance/pd.go +++ b/components/playground/instance/pd.go @@ -37,7 +37,7 @@ const ( // PDRoleScheduling is the role of PD scheduling PDRoleScheduling PDRole = "scheduling" // PDRoleResourceManager is the role of PD resource manager - PDRoleResourceManager PDRole = "resource manager" + PDRoleResourceManager PDRole = "resource_manager" ) // PDInstance represent a running pd-server diff --git a/components/playground/playground.go b/components/playground/playground.go index ca5005292e..b172e379fb 100644 --- a/components/playground/playground.go +++ b/components/playground/playground.go @@ -697,6 +697,10 @@ func (p *Playground) addInstance(componentID string, pdRole instance.PDRole, tif id := p.allocID(componentID) dir := filepath.Join(dataDir, fmt.Sprintf("%s-%d", componentID, id)) + if componentID == string(instance.PDRoleNormal) && pdRole != instance.PDRoleNormal { + id = p.allocID(fmt.Sprintf("%s-%s", componentID, pdRole)) + dir = filepath.Join(dataDir, fmt.Sprintf("%s-%s-%d", componentID, pdRole, id)) + } if err = utils.MkdirAll(dir, 0755); err != nil { return nil, err }