Files
Lina JodoinandStephan Behnke f5e851c462 Scheduler Bugfix: getFutureActionTimes should ignore actions prior to update time, respect RemainingActions counter (#6122)
## What changed/why?
In #6028/#5381, our scheduler's run loop accounted for update requests
that occur between nominal and actual/jittered times. The run loop will
correctly skip over action times who are scheduled prior to the
schedule's update time (such as when a schedule is recalculated to a new
spec). This PR updates `getFutureActionTimes` (used as part of the
scheduler's describe and list operations) to account for action times
preceding the update time, as well as to properly reflect the number of
remaining actions in a schedule.

## How did you test it?
- Updated unit tests for both limited actions (`TestLimitedActions`) as
well as filtered update times (`TestUpdateNotRetroactive`).
`TestUpdateNotRetroactive` is the test that goes red when the [parallel
condition in the
scheduler](https://github.com/temporalio/temporal/blob/0e2397ecb4a7d7611f918675f80fa6ed8e85199d/service/worker/scheduler/workflow.go#L655-L660)
is commented out, so it seemed the appropriate place to also test
`getFutureActionTimes` lines up with the fix in the run loop.
- Verified both updated tests only pass when new version
(`AccurateFutureActionTimes`) is set; verified no other tests break
(`make test-unit`)

## Potential risks
- We break a use case that relied on speculative future action times/a
constant number of action times returned

## Documentation
N/A

## Is hotfix candidate?
No
2024-06-14 11:47:54 -07:00
..

Temporal Worker

Temporal Worker is a role for Temporal service used for hosting any components responsible for performing background processing on the Temporal cluster.

Replicator

Replicator is a background worker responsible for consuming replication tasks generated by remote Temporal clusters and pass it down to processor, so they can be applied to local Temporal cluster.

Quickstart for localhost development

  1. Start Temporal development server for active zone:

    make start-cdc-active
    
  2. Start Temporal development server for standby(passive) zone:

    make start-cdc-standby
    
  3. Connect two Temporal clusters:

    tctl --ad 127.0.0.1:7233 adm cl upsert-remote-cluster --frontend_address "localhost:8233"
    tctl --ad 127.0.0.1:8233 adm cl upsert-remote-cluster --frontend_address "localhost:7233"
    
  4. Create global namespaces

    tctl --ns sample namespace register --gd true --ac active --cl active standby
    
  5. Failover between zones:

    Failover to standby:

    tctl --ns sample namespace update --ac standby
    

    Failback to active:

    tctl --ns sample namespace update --ac active