@@ -38,6 +38,9 @@ const (
3838 defaultEnablePVReclaim = false
3939 // defaultEvictLeaderTimeout is the timeout limit of evict leader
4040 defaultEvictLeaderTimeout = 1500 * time .Minute
41+ // defaultTiCDCGracefulShutdownTimeout is the timeout limit of graceful
42+ // shutdown a TiCDC pod.
43+ defaultTiCDCGracefulShutdownTimeout = 10 * time .Minute
4144)
4245
4346var (
@@ -194,6 +197,14 @@ func (tc *TidbCluster) TiFlashVersion() string {
194197 return "latest"
195198}
196199
200+ func (tc * TidbCluster ) TiFlashContainerPrivilege () * bool {
201+ if tc .Spec .TiFlash == nil || tc .Spec .TiFlash .Privileged == nil {
202+ pri := false
203+ return & pri
204+ }
205+ return tc .Spec .TiFlash .Privileged
206+ }
207+
197208// TiCDCImage return the image used by TiCDC.
198209//
199210// If TiCDC isn't specified, return empty string.
@@ -219,12 +230,13 @@ func (tc *TidbCluster) TiCDCImage() string {
219230 return image
220231}
221232
222- func (tc * TidbCluster ) TiFlashContainerPrivilege () * bool {
223- if tc .Spec .TiFlash == nil || tc .Spec .TiFlash .Privileged == nil {
224- pri := false
225- return & pri
233+ // TiCDCGracefulShutdownTimeout returns the timeout of gracefully shutdown
234+ // a TiCDC pod.
235+ func (tc * TidbCluster ) TiCDCGracefulShutdownTimeout () time.Duration {
236+ if tc .Spec .TiCDC != nil && tc .Spec .TiCDC .GracefulShutdownTimeout != nil {
237+ return tc .Spec .TiCDC .GracefulShutdownTimeout .Duration
226238 }
227- return tc . Spec . TiFlash . Privileged
239+ return defaultTiCDCGracefulShutdownTimeout
228240}
229241
230242// TiDBImage return the image used by TiDB.
0 commit comments