@@ -344,24 +344,24 @@ func (c *RaftCluster) Start(s Server, bootstrap bool) (err error) {
344344 return nil
345345 }
346346 c .isKeyspaceGroupEnabled = s .IsKeyspaceGroupEnabled ()
347- log .Info ("[leader-ready ] start to initialize cluster" )
347+ log .Info ("[raft-cluster-start ] start to initialize cluster" )
348348 initClusterStart := time .Now ()
349349 err = c .InitCluster (s .GetAllocator (), s .GetPersistOptions (), s .GetHBStreams (), s .GetKeyspaceGroupManager ())
350350 if err != nil {
351- log .Warn ("[leader-ready ] failed to initialize cluster" , errs .ZapError (err ), zap .Duration ("cost" , time .Since (initClusterStart )))
351+ log .Warn ("[raft-cluster-start ] failed to initialize cluster" , errs .ZapError (err ), zap .Duration ("cost" , time .Since (initClusterStart )))
352352 return err
353353 }
354354 initClusterDuration := time .Since (initClusterStart )
355- log .Info ("[leader-ready ] initialize cluster completed" , zap .Duration ("cost" , initClusterDuration ))
355+ log .Info ("[raft-cluster-start ] initialize cluster completed" , zap .Duration ("cost" , initClusterDuration ))
356356 // We should not manage tso service when bootstrap try to start raft cluster.
357357 // It only is controlled by leader election.
358358 // Ref: https://github.com/tikv/pd/issues/8836
359359 if ! bootstrap {
360- log .Info ("[leader-ready ] start to check TSO service" )
360+ log .Info ("[raft-cluster-start ] start to check TSO service" )
361361 checkTSOStart := time .Now ()
362362 c .checkTSOService ()
363363 checkTSODuration := time .Since (checkTSOStart )
364- log .Info ("[leader-ready ] check TSO service completed" , zap .Duration ("cost" , checkTSODuration ))
364+ log .Info ("[raft-cluster-start ] check TSO service completed" , zap .Duration ("cost" , checkTSODuration ))
365365 }
366366 defer func () {
367367 if ! bootstrap && err != nil {
@@ -376,39 +376,39 @@ func (c *RaftCluster) Start(s Server, bootstrap bool) (err error) {
376376 }
377377 failpoint .Return (err )
378378 })
379- log .Info ("[leader-ready ] start to load cluster info" )
379+ log .Info ("[raft-cluster-start ] start to load cluster info" )
380380 loadClusterInfoStart := time .Now ()
381381 cluster , err := c .LoadClusterInfo ()
382382 if err != nil {
383- log .Warn ("[leader-ready ] failed to load cluster info" , errs .ZapError (err ), zap .Duration ("cost" , time .Since (loadClusterInfoStart )))
383+ log .Warn ("[raft-cluster-start ] failed to load cluster info" , errs .ZapError (err ), zap .Duration ("cost" , time .Since (loadClusterInfoStart )))
384384 return err
385385 }
386386 if cluster == nil {
387387 loadClusterInfoDuration := time .Since (loadClusterInfoStart )
388- log .Warn ("[leader-ready ] cluster is not bootstrapped" , zap .Duration ("cost" , loadClusterInfoDuration ))
388+ log .Warn ("[raft-cluster-start ] cluster is not bootstrapped" , zap .Duration ("cost" , loadClusterInfoDuration ))
389389 return nil
390390 }
391391 if c .opt .IsPlacementRulesEnabled () {
392392 ruleInitStart := time .Now ()
393393 err := c .ruleManager .Initialize (c .opt .GetMaxReplicas (), c .opt .GetLocationLabels (), c .opt .GetIsolationLevel (), false )
394394 if err != nil {
395- log .Warn ("[leader-ready ] failed to initialize placement rules" , errs .ZapError (err ), zap .Duration ("cost" , time .Since (ruleInitStart )))
395+ log .Warn ("[raft-cluster-start ] failed to initialize placement rules" , errs .ZapError (err ), zap .Duration ("cost" , time .Since (ruleInitStart )))
396396 return err
397397 }
398- log .Info ("[leader-ready ] initialize placement rules completed" , zap .Duration ("cost" , time .Since (ruleInitStart )))
398+ log .Info ("[raft-cluster-start ] initialize placement rules completed" , zap .Duration ("cost" , time .Since (ruleInitStart )))
399399 }
400400 loadClusterInfoDuration := time .Since (loadClusterInfoStart )
401- log .Info ("[leader-ready ] load cluster info completed" , zap .Duration ("cost" , loadClusterInfoDuration ))
401+ log .Info ("[raft-cluster-start ] load cluster info completed" , zap .Duration ("cost" , loadClusterInfoDuration ))
402402
403- log .Info ("[leader-ready ] creating region labeler" )
403+ log .Info ("[raft-cluster-start ] creating region labeler" )
404404 labelerStart := time .Now ()
405405 c .regionLabeler , err = labeler .NewRegionLabeler (c .ctx , c .storage , regionLabelGCInterval )
406406 labelerDuration := time .Since (labelerStart )
407407 if err != nil {
408- log .Warn ("[leader-ready ] region labeler creation failed" , zap .Error (err ), zap .Duration ("cost" , labelerDuration ))
408+ log .Warn ("[raft-cluster-start ] region labeler creation failed" , zap .Error (err ), zap .Duration ("cost" , labelerDuration ))
409409 return err
410410 }
411- log .Info ("[leader-ready ] region labeler created" , zap .Duration ("cost" , labelerDuration ))
411+ log .Info ("[raft-cluster-start ] region labeler created" , zap .Duration ("cost" , labelerDuration ))
412412
413413 // create affinity manager with region labeler for key range validation and rebuild
414414 c .affinityManager , err = affinity .NewManager (c .ctx , c .storage , c , c .GetOpts (), c .regionLabeler )
@@ -417,52 +417,52 @@ func (c *RaftCluster) Start(s Server, bootstrap bool) (err error) {
417417 }
418418
419419 if ! c .IsServiceIndependent (constant .SchedulingServiceName ) {
420- log .Info ("[leader-ready ] start to observe slow store status" )
420+ log .Info ("[raft-cluster-start ] start to observe slow store status" )
421421 observeSlowStoreStart := time .Now ()
422422 for _ , store := range c .GetStores () {
423423 storeID := store .GetID ()
424424 c .slowStat .ObserveSlowStoreStatus (storeID , store .IsSlow ())
425425 }
426426 observeSlowStoreDuration := time .Since (observeSlowStoreStart )
427- log .Info ("[leader-ready ] observe slow store status completed" , zap .Duration ("cost" , observeSlowStoreDuration ))
427+ log .Info ("[raft-cluster-start ] observe slow store status completed" , zap .Duration ("cost" , observeSlowStoreDuration ))
428428 }
429- log .Info ("[leader-ready ] start to create replication mode manager" )
429+ log .Info ("[raft-cluster-start ] start to create replication mode manager" )
430430 replicationModeStart := time .Now ()
431431 c .replicationMode , err = replication .NewReplicationModeManager (s .GetConfig ().ReplicationMode , c .storage , cluster , s )
432432 if err != nil {
433- log .Warn ("[leader-ready ] failed to create replication mode manager" , errs .ZapError (err ), zap .Duration ("cost" , time .Since (replicationModeStart )))
433+ log .Warn ("[raft-cluster-start ] failed to create replication mode manager" , errs .ZapError (err ), zap .Duration ("cost" , time .Since (replicationModeStart )))
434434 return err
435435 }
436436 replicationModeDuration := time .Since (replicationModeStart )
437- log .Info ("[leader-ready ] create replication mode manager completed" , zap .Duration ("cost" , replicationModeDuration ))
438- log .Info ("[leader-ready ] start to load external timestamp" )
437+ log .Info ("[raft-cluster-start ] create replication mode manager completed" , zap .Duration ("cost" , replicationModeDuration ))
438+ log .Info ("[raft-cluster-start ] start to load external timestamp" )
439439 loadExternalTSStart := time .Now ()
440440 c .loadExternalTS ()
441- log .Info ("[leader-ready ] load external timestamp completed" , zap .Duration ("cost" , time .Since (loadExternalTSStart )))
442- log .Info ("[leader-ready ] start to load min resolved ts" )
441+ log .Info ("[raft-cluster-start ] load external timestamp completed" , zap .Duration ("cost" , time .Since (loadExternalTSStart )))
442+ log .Info ("[raft-cluster-start ] start to load min resolved ts" )
443443 loadMinResolvedTSStart := time .Now ()
444444 c .loadMinResolvedTS ()
445- log .Info ("[leader-ready ] load min resolved ts completed" , zap .Duration ("cost" , time .Since (loadMinResolvedTSStart )))
445+ log .Info ("[raft-cluster-start ] load min resolved ts completed" , zap .Duration ("cost" , time .Since (loadMinResolvedTSStart )))
446446
447447 if c .isKeyspaceGroupEnabled {
448448 // bootstrap keyspace group manager after starting other parts successfully.
449449 // This order avoids a stuck goroutine in keyspaceGroupManager when it fails to create raftcluster.
450- log .Info ("[leader-ready ] start to bootstrap keyspace group manager" )
450+ log .Info ("[raft-cluster-start ] start to bootstrap keyspace group manager" )
451451 bootstrapKeyspaceStart := time .Now ()
452452 err = c .keyspaceGroupManager .Bootstrap (c .ctx )
453453 if err != nil {
454- log .Warn ("[leader-ready ] failed to bootstrap keyspace group manager" , errs .ZapError (err ), zap .Duration ("cost" , time .Since (bootstrapKeyspaceStart )))
454+ log .Warn ("[raft-cluster-start ] failed to bootstrap keyspace group manager" , errs .ZapError (err ), zap .Duration ("cost" , time .Since (bootstrapKeyspaceStart )))
455455 return err
456456 }
457457 bootstrapKeyspaceDuration := time .Since (bootstrapKeyspaceStart )
458- log .Info ("[leader-ready ] bootstrap keyspace group manager completed" , zap .Duration ("cost" , bootstrapKeyspaceDuration ))
458+ log .Info ("[raft-cluster-start ] bootstrap keyspace group manager completed" , zap .Duration ("cost" , bootstrapKeyspaceDuration ))
459459 }
460- log .Info ("[leader-ready ] start to check scheduling service" )
460+ log .Info ("[raft-cluster-start ] start to check scheduling service" )
461461 checkSchedulingStart := time .Now ()
462462 c .checkSchedulingService ()
463463 checkSchedulingDuration := time .Since (checkSchedulingStart )
464- log .Info ("[leader-ready ] check scheduling service completed" , zap .Duration ("cost" , checkSchedulingDuration ))
465- log .Info ("[leader-ready ] start to start background jobs" )
464+ log .Info ("[raft-cluster-start ] check scheduling service completed" , zap .Duration ("cost" , checkSchedulingDuration ))
465+ log .Info ("[raft-cluster-start ] start to start background jobs" )
466466 backgroundJobsStart := time .Now ()
467467 c .wg .Add (11 )
468468 go c .runServiceCheckJob ()
@@ -477,17 +477,17 @@ func (c *RaftCluster) Start(s Server, bootstrap bool) (err error) {
477477 go c .startProgressGC ()
478478 go c .runStorageSizeCollector (s .GetMeteringWriter (), c .regionLabeler , s .GetKeyspaceManager ())
479479 backgroundJobsDuration := time .Since (backgroundJobsStart )
480- log .Info ("[leader-ready ] start background jobs completed" , zap .Duration ("cost" , backgroundJobsDuration ))
480+ log .Info ("[raft-cluster-start ] start background jobs completed" , zap .Duration ("cost" , backgroundJobsDuration ))
481481
482- log .Info ("[leader-ready ] start to start runners" )
482+ log .Info ("[raft-cluster-start ] start to start runners" )
483483 runnersStart := time .Now ()
484484 c .running = true
485485 c .heartbeatRunner .Start (c .ctx )
486486 c .miscRunner .Start (c .ctx )
487487 c .logRunner .Start (c .ctx )
488488 c .syncRegionRunner .Start (c .ctx )
489489 runnersDuration := time .Since (runnersStart )
490- log .Info ("[leader-ready ] start runners completed" , zap .Duration ("cost" , runnersDuration ))
490+ log .Info ("[raft-cluster-start ] start runners completed" , zap .Duration ("cost" , runnersDuration ))
491491 return nil
492492}
493493
0 commit comments