-
Notifications
You must be signed in to change notification settings - Fork 754
/
timerQueueStandbyTaskExecutor.go
613 lines (548 loc) · 20 KB
/
timerQueueStandbyTaskExecutor.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
// The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
//
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package history
import (
"context"
"fmt"
"time"
commonpb "go.temporal.io/api/common/v1"
enumspb "go.temporal.io/api/enums/v1"
"go.temporal.io/api/serviceerror"
taskqueuepb "go.temporal.io/api/taskqueue/v1"
"go.temporal.io/server/api/matchingservice/v1"
"go.temporal.io/server/common"
"go.temporal.io/server/common/log"
"go.temporal.io/server/common/log/tag"
"go.temporal.io/server/common/metrics"
"go.temporal.io/server/common/namespace"
"go.temporal.io/server/common/xdc"
"go.temporal.io/server/service/history/configs"
"go.temporal.io/server/service/history/consts"
"go.temporal.io/server/service/history/queues"
"go.temporal.io/server/service/history/shard"
"go.temporal.io/server/service/history/tasks"
"go.temporal.io/server/service/history/vclock"
"go.temporal.io/server/service/history/workflow"
)
type (
timerQueueStandbyTaskExecutor struct {
*timerQueueTaskExecutorBase
clusterName string
nDCHistoryResender xdc.NDCHistoryResender
}
)
func newTimerQueueStandbyTaskExecutor(
shard shard.Context,
workflowCache workflow.Cache,
workflowDeleteManager workflow.DeleteManager,
nDCHistoryResender xdc.NDCHistoryResender,
matchingClient matchingservice.MatchingServiceClient,
logger log.Logger,
metricProvider metrics.MetricsHandler,
clusterName string,
config *configs.Config,
) queues.Executor {
return &timerQueueStandbyTaskExecutor{
timerQueueTaskExecutorBase: newTimerQueueTaskExecutorBase(
shard,
workflowCache,
workflowDeleteManager,
matchingClient,
logger,
metricProvider,
config,
),
clusterName: clusterName,
nDCHistoryResender: nDCHistoryResender,
}
}
func (t *timerQueueStandbyTaskExecutor) Execute(
ctx context.Context,
executable queues.Executable,
) ([]metrics.Tag, bool, error) {
task := executable.GetTask()
taskType := queues.GetStandbyTimerTaskTypeTagValue(task)
metricsTags := []metrics.Tag{
getNamespaceTagByID(t.shard.GetNamespaceRegistry(), task.GetNamespaceID()),
metrics.TaskTypeTag(taskType),
metrics.OperationTag(taskType), // for backward compatibility
}
var err error
switch task := task.(type) {
case *tasks.UserTimerTask:
err = t.executeUserTimerTimeoutTask(ctx, task)
case *tasks.ActivityTimeoutTask:
err = t.executeActivityTimeoutTask(ctx, task)
case *tasks.WorkflowTaskTimeoutTask:
err = t.executeWorkflowTaskTimeoutTask(ctx, task)
case *tasks.WorkflowBackoffTimerTask:
err = t.executeWorkflowBackoffTimerTask(ctx, task)
case *tasks.ActivityRetryTimerTask:
err = t.executeActivityRetryTimerTask(ctx, task)
case *tasks.WorkflowTimeoutTask:
err = t.executeWorkflowTimeoutTask(ctx, task)
case *tasks.DeleteHistoryEventTask:
err = t.executeDeleteHistoryEventTask(ctx, task)
default:
err = errUnknownTimerTask
}
return metricsTags, false, err
}
func (t *timerQueueStandbyTaskExecutor) executeUserTimerTimeoutTask(
ctx context.Context,
timerTask *tasks.UserTimerTask,
) error {
actionFn := func(_ context.Context, wfContext workflow.Context, mutableState workflow.MutableState) (interface{}, error) {
timerSequence := t.getTimerSequence(mutableState)
timerSequenceIDs := timerSequence.LoadAndSortUserTimers()
if len(timerSequenceIDs) > 0 {
timerSequenceID := timerSequenceIDs[0]
_, ok := mutableState.GetUserTimerInfoByEventID(timerSequenceID.EventID)
if !ok {
errString := fmt.Sprintf("failed to find in user timer event ID: %v", timerSequenceID.EventID)
t.logger.Error(errString)
return nil, serviceerror.NewInternal(errString)
}
if queues.IsTimeExpired(
timerTask.GetVisibilityTime(),
timerSequenceID.Timestamp,
) {
return getHistoryResendInfo(mutableState)
}
// Since the user timers are already sorted, then if there is one timer which is not expired,
// all user timers after that timer are not expired.
}
// If there is no user timer expired, then we are good.
return nil, nil
}
return t.processTimer(
ctx,
timerTask,
actionFn,
getStandbyPostActionFn(
timerTask,
t.getCurrentTime,
t.config.StandbyTaskMissingEventsResendDelay(timerTask.GetType()),
t.config.StandbyTaskMissingEventsDiscardDelay(timerTask.GetType()),
t.fetchHistoryFromRemote,
standbyTimerTaskPostActionTaskDiscarded,
),
)
}
func (t *timerQueueStandbyTaskExecutor) executeActivityTimeoutTask(
ctx context.Context,
timerTask *tasks.ActivityTimeoutTask,
) error {
// activity heartbeat timer task is a special snowflake.
// normal activity timer task on the passive side will be generated by events related to activity in history replicator,
// and the standby timer processor will only need to verify whether the timer task can be safely throw away.
//
// activity heartbeat timer task cannot be handled in the way mentioned above.
// the reason is, there is no event driving the creation of new activity heartbeat timer.
// although there will be an task syncing activity from remote, the task is not an event,
// and cannot attempt to recreate a new activity timer task.
//
// the overall solution is to attempt to generate a new activity timer task whenever the
// task passed in is safe to be throw away.
actionFn := func(ctx context.Context, wfContext workflow.Context, mutableState workflow.MutableState) (interface{}, error) {
timerSequence := t.getTimerSequence(mutableState)
updateMutableState := false
timerSequenceIDs := timerSequence.LoadAndSortActivityTimers()
if len(timerSequenceIDs) > 0 {
timerSequenceID := timerSequenceIDs[0]
_, ok := mutableState.GetActivityInfo(timerSequenceID.EventID)
if !ok {
errString := fmt.Sprintf("failed to find in memory activity timer: %v", timerSequenceID.EventID)
t.logger.Error(errString)
return nil, serviceerror.NewInternal(errString)
}
if queues.IsTimeExpired(
timerTask.GetVisibilityTime(),
timerSequenceID.Timestamp,
) {
return getHistoryResendInfo(mutableState)
}
// Since the activity timers are already sorted, then if there is one timer which is not expired,
// all activity timers after that timer are not expired.
}
// for reason to update mutable state & generate a new activity task,
// see comments at the beginning of this function.
// NOTE: this is the only place in the standby logic where mutable state can be updated
// need to clear the activity heartbeat timer task marks
lastWriteVersion, err := mutableState.GetLastWriteVersion()
if err != nil {
return nil, err
}
// NOTE: LastHeartbeatTimeoutVisibilityInSeconds is for deduping heartbeat timer creation as it's possible
// one heartbeat task was persisted multiple times with different taskIDs due to the retry logic
// for updating workflow execution. In that case, only one new heartbeat timeout task should be
// created.
isHeartBeatTask := timerTask.TimeoutType == enumspb.TIMEOUT_TYPE_HEARTBEAT
activityInfo, heartbeatTimeoutVis, ok := mutableState.GetActivityInfoWithTimerHeartbeat(timerTask.EventID)
if isHeartBeatTask && ok && queues.IsTimeExpired(timerTask.GetVisibilityTime(), heartbeatTimeoutVis) {
activityInfo.TimerTaskStatus = activityInfo.TimerTaskStatus &^ workflow.TimerTaskStatusCreatedHeartbeat
if err := mutableState.UpdateActivity(activityInfo); err != nil {
return nil, err
}
updateMutableState = true
}
// passive logic need to explicitly call create timer
modified, err := timerSequence.CreateNextActivityTimer()
if err != nil {
return nil, err
}
updateMutableState = updateMutableState || modified
if !updateMutableState {
return nil, nil
}
now := t.getStandbyClusterTime()
// we need to handcraft some of the variables
// since the job being done here is update the activity and possibly write a timer task to DB
// also need to reset the current version.
if err := mutableState.UpdateCurrentVersion(lastWriteVersion, true); err != nil {
return nil, err
}
err = wfContext.UpdateWorkflowExecutionAsPassive(ctx, now)
return nil, err
}
return t.processTimer(
ctx,
timerTask,
actionFn,
getStandbyPostActionFn(
timerTask,
t.getCurrentTime,
t.config.StandbyTaskMissingEventsResendDelay(timerTask.GetType()),
t.config.StandbyTaskMissingEventsDiscardDelay(timerTask.GetType()),
t.fetchHistoryFromRemote,
standbyTimerTaskPostActionTaskDiscarded,
),
)
}
func (t *timerQueueStandbyTaskExecutor) executeActivityRetryTimerTask(
ctx context.Context,
task *tasks.ActivityRetryTimerTask,
) (retError error) {
actionFn := func(_ context.Context, wfContext workflow.Context, mutableState workflow.MutableState) (interface{}, error) {
activityInfo, ok := mutableState.GetActivityInfo(task.EventID) // activity schedule ID
if !ok {
return nil, nil
}
ok = VerifyTaskVersion(t.shard, t.logger, mutableState.GetNamespaceEntry(), activityInfo.Version, task.Version, task)
if !ok {
return nil, nil
}
if activityInfo.Attempt > task.Attempt {
return nil, nil
}
if activityInfo.StartedEventId != common.EmptyEventID {
return nil, nil
}
return newActivityRetryTimePostActionInfo(mutableState, activityInfo.TaskQueue, *activityInfo.ScheduleToStartTimeout)
}
return t.processTimer(
ctx,
task,
actionFn,
getStandbyPostActionFn(
task,
t.getCurrentTime,
t.config.StandbyTaskMissingEventsResendDelay(task.GetType()),
t.config.StandbyTaskMissingEventsDiscardDelay(task.GetType()),
t.fetchHistoryFromRemote,
t.pushActivity,
),
)
}
func (t *timerQueueStandbyTaskExecutor) executeWorkflowTaskTimeoutTask(
ctx context.Context,
timerTask *tasks.WorkflowTaskTimeoutTask,
) error {
// workflow task schedule to start timer task is a special snowflake.
// the schedule to start timer is for sticky workflow task, which is
// not applicable on the passive cluster
if timerTask.TimeoutType == enumspb.TIMEOUT_TYPE_SCHEDULE_TO_START {
return nil
}
actionFn := func(_ context.Context, wfContext workflow.Context, mutableState workflow.MutableState) (interface{}, error) {
workflowTask, isPending := mutableState.GetWorkflowTaskInfo(timerTask.EventID)
if !isPending {
return nil, nil
}
ok := VerifyTaskVersion(t.shard, t.logger, mutableState.GetNamespaceEntry(), workflowTask.Version, timerTask.Version, timerTask)
if !ok {
return nil, nil
}
return getHistoryResendInfo(mutableState)
}
return t.processTimer(
ctx,
timerTask,
actionFn,
getStandbyPostActionFn(
timerTask,
t.getCurrentTime,
t.config.StandbyTaskMissingEventsResendDelay(timerTask.GetType()),
t.config.StandbyTaskMissingEventsDiscardDelay(timerTask.GetType()),
t.fetchHistoryFromRemote,
standbyTimerTaskPostActionTaskDiscarded,
),
)
}
func (t *timerQueueStandbyTaskExecutor) executeWorkflowBackoffTimerTask(
ctx context.Context,
timerTask *tasks.WorkflowBackoffTimerTask,
) error {
actionFn := func(_ context.Context, wfContext workflow.Context, mutableState workflow.MutableState) (interface{}, error) {
if mutableState.HasProcessedOrPendingWorkflowTask() {
// if there is one workflow task already been processed
// or has pending workflow task, meaning workflow has already running
return nil, nil
}
// Note: do not need to verify task version here
// logic can only go here if mutable state build's next event ID is 2
// meaning history only contains workflow started event.
// we can do the checking of task version vs workflow started version
// however, workflow started version is immutable
// active cluster will add first workflow task after backoff timeout.
// standby cluster should just call ack manager to retry this task
// since we are stilling waiting for the first WorkflowTaskScheduledEvent to be replicated from active side.
return getHistoryResendInfo(mutableState)
}
return t.processTimer(
ctx,
timerTask,
actionFn,
getStandbyPostActionFn(
timerTask,
t.getCurrentTime,
t.config.StandbyTaskMissingEventsResendDelay(timerTask.GetType()),
t.config.StandbyTaskMissingEventsDiscardDelay(timerTask.GetType()),
t.fetchHistoryFromRemote,
standbyTimerTaskPostActionTaskDiscarded,
),
)
}
func (t *timerQueueStandbyTaskExecutor) executeWorkflowTimeoutTask(
ctx context.Context,
timerTask *tasks.WorkflowTimeoutTask,
) error {
actionFn := func(_ context.Context, wfContext workflow.Context, mutableState workflow.MutableState) (interface{}, error) {
// we do not need to notify new timer to base, since if there is no new event being replicated
// checking again if the timer can be completed is meaningless
startVersion, err := mutableState.GetStartVersion()
if err != nil {
return nil, err
}
ok := VerifyTaskVersion(t.shard, t.logger, mutableState.GetNamespaceEntry(), startVersion, timerTask.Version, timerTask)
if !ok {
return nil, nil
}
return getHistoryResendInfo(mutableState)
}
return t.processTimer(
ctx,
timerTask,
actionFn,
getStandbyPostActionFn(
timerTask,
t.getCurrentTime,
t.config.StandbyTaskMissingEventsResendDelay(timerTask.GetType()),
t.config.StandbyTaskMissingEventsDiscardDelay(timerTask.GetType()),
t.fetchHistoryFromRemote,
standbyTimerTaskPostActionTaskDiscarded,
),
)
}
func (t *timerQueueStandbyTaskExecutor) getStandbyClusterTime() time.Time {
// time of remote cluster in the shard is delayed by "StandbyClusterDelay"
// so to get the current accurate remote cluster time, need to add it back
currentTime := t.shard.GetCurrentTime(t.clusterName)
if t.clusterName != t.shard.GetClusterMetadata().GetCurrentClusterName() {
currentTime.Add(t.shard.GetConfig().StandbyClusterDelay())
}
return currentTime
}
func (t *timerQueueStandbyTaskExecutor) getTimerSequence(
mutableState workflow.MutableState,
) workflow.TimerSequence {
return workflow.NewTimerSequence(mutableState)
}
func (t *timerQueueStandbyTaskExecutor) processTimer(
ctx context.Context,
timerTask tasks.Task,
actionFn standbyActionFn,
postActionFn standbyPostActionFn,
) (retError error) {
ctx, cancel := context.WithTimeout(ctx, taskTimeout)
defer cancel()
executionContext, release, err := getWorkflowExecutionContextForTask(ctx, t.cache, timerTask)
if err != nil {
return err
}
defer func() {
if retError == consts.ErrTaskRetry {
release(nil)
} else {
release(retError)
}
}()
mutableState, err := loadMutableStateForTimerTask(ctx, executionContext, timerTask, t.metricsClient, t.logger)
if err != nil {
return err
}
if mutableState == nil {
return nil
}
if !mutableState.IsWorkflowExecutionRunning() {
// workflow already finished, no need to process the timer
return nil
}
historyResendInfo, err := actionFn(ctx, executionContext, mutableState)
if err != nil {
return err
}
// NOTE: do not access anything related mutable state after this lock release
release(nil)
return postActionFn(ctx, timerTask, historyResendInfo, t.logger)
}
func (t *timerQueueStandbyTaskExecutor) fetchHistoryFromRemote(
ctx context.Context,
taskInfo tasks.Task,
postActionInfo interface{},
logger log.Logger,
) error {
var resendInfo *historyResendInfo
switch postActionInfo := postActionInfo.(type) {
case nil:
return nil
case *historyResendInfo:
resendInfo = postActionInfo
case *activityTaskPostActionInfo:
resendInfo = postActionInfo.historyResendInfo
default:
logger.Fatal("unknown post action info for fetching remote history", tag.Value(postActionInfo))
}
remoteClusterName, err := getRemoteClusterName(
t.currentClusterName,
t.registry,
taskInfo.GetNamespaceID(),
)
if err != nil {
return err
}
t.metricsClient.IncCounter(metrics.HistoryRereplicationByTimerTaskScope, metrics.ClientRequests)
stopwatch := t.metricsClient.StartTimer(metrics.HistoryRereplicationByTimerTaskScope, metrics.ClientLatency)
defer stopwatch.Stop()
adminClient, err := t.shard.GetRemoteAdminClient(remoteClusterName)
if err != nil {
return err
}
if resendInfo.lastEventID == common.EmptyEventID || resendInfo.lastEventVersion == common.EmptyVersion {
t.logger.Error("Error re-replicating history from remote: timerQueueStandbyProcessor encountered empty historyResendInfo.",
tag.ShardID(t.shard.GetShardID()),
tag.WorkflowNamespaceID(taskInfo.GetNamespaceID()),
tag.WorkflowID(taskInfo.GetWorkflowID()),
tag.WorkflowRunID(taskInfo.GetRunID()),
tag.ClusterName(remoteClusterName))
return consts.ErrTaskRetry
}
if err = refreshTasks(
ctx,
adminClient,
namespace.ID(taskInfo.GetNamespaceID()),
taskInfo.GetWorkflowID(),
taskInfo.GetRunID(),
); err != nil {
if _, isNotFound := err.(*serviceerror.NamespaceNotFound); isNotFound {
// Don't log NamespaceNotFound error because it is valid case, and return error to stop retrying.
return err
}
t.logger.Error("Error refresh tasks from remote.",
tag.ShardID(t.shard.GetShardID()),
tag.WorkflowNamespaceID(taskInfo.GetNamespaceID()),
tag.WorkflowID(taskInfo.GetWorkflowID()),
tag.WorkflowRunID(taskInfo.GetRunID()),
tag.ClusterName(remoteClusterName),
tag.Error(err))
}
// NOTE: history resend may take long time and its timeout is currently
// controlled by a separate dynamicconfig config: StandbyTaskReReplicationContextTimeout
if err = t.nDCHistoryResender.SendSingleWorkflowHistory(
ctx,
remoteClusterName,
namespace.ID(taskInfo.GetNamespaceID()),
taskInfo.GetWorkflowID(),
taskInfo.GetRunID(),
resendInfo.lastEventID,
resendInfo.lastEventVersion,
common.EmptyEventID,
common.EmptyVersion,
); err != nil {
if _, isNotFound := err.(*serviceerror.NamespaceNotFound); isNotFound {
// Don't log NamespaceNotFound error because it is valid case, and return error to stop retrying.
return err
}
t.logger.Error("Error re-replicating history from remote.",
tag.ShardID(t.shard.GetShardID()),
tag.WorkflowNamespaceID(taskInfo.GetNamespaceID()),
tag.WorkflowID(taskInfo.GetWorkflowID()),
tag.WorkflowRunID(taskInfo.GetRunID()),
tag.ClusterName(remoteClusterName),
tag.Error(err))
}
// Return retryable error, so task processing will retry.
return consts.ErrTaskRetry
}
func (t *timerQueueStandbyTaskExecutor) pushActivity(
ctx context.Context,
task tasks.Task,
postActionInfo interface{},
logger log.Logger,
) error {
if postActionInfo == nil {
return nil
}
pushActivityInfo := postActionInfo.(*activityTaskPostActionInfo)
activityScheduleToStartTimeout := &pushActivityInfo.activityTaskScheduleToStartTimeout
activityTask := task.(*tasks.ActivityRetryTimerTask)
_, err := t.matchingClient.AddActivityTask(ctx, &matchingservice.AddActivityTaskRequest{
NamespaceId: activityTask.NamespaceID,
Execution: &commonpb.WorkflowExecution{
WorkflowId: activityTask.WorkflowID,
RunId: activityTask.RunID,
},
TaskQueue: &taskqueuepb.TaskQueue{
Name: pushActivityInfo.taskQueue,
Kind: enumspb.TASK_QUEUE_KIND_NORMAL,
},
ScheduledEventId: activityTask.EventID,
ScheduleToStartTimeout: activityScheduleToStartTimeout,
Clock: vclock.NewVectorClock(t.shard.GetClusterMetadata().GetClusterID(), t.shard.GetShardID(), activityTask.TaskID),
})
return err
}
func (t *timerQueueStandbyTaskExecutor) getCurrentTime() time.Time {
return t.shard.GetCurrentTime(t.clusterName)
}