Files
ShivamandYichao Yang cc5fdede7d clear drainage status of a rollbacked version workflow (#8119)
- When a deactivated (drained/draining) version gets rollbacked to
becoming active again, the drainage information that was associated with
it will get cleared.
- This is required because when this version were to get deactivated
again, we need the code to start the drainage process on it again. Right
now, it was not doing that since we were not clearing the drainage
information which did not start a fresh drainage tracker for this
version!

*NOTE*: This change requires a patch to be present. This is because when
this scenario is replicated in production, it will result in two new
history calls (syncSummary as well as a CAN of the version workflow).
This will specifically happen when the rolled-back version gets
deactivated eventually, over
[here](https://github.com/temporalio/temporal/blob/d85e67120957a16e0c14278bfb00e80412f16f5c/service/worker/workerdeployment/version_workflow.go#L546)
- note how previously, since the drainage information was not cleared,
[this](https://github.com/temporalio/temporal/blob/d85e67120957a16e0c14278bfb00e80412f16f5c/service/worker/workerdeployment/version_workflow.go#L261)
was never executed!)

*How did I verify that this requires a patch*:

- Ran the replay test script before the fix introduced in this PR and
noticed:
<img width="793" height="79" alt="image"
src="https://github.com/user-attachments/assets/bb975d26-4ad1-4847-b477-b74c7d2f55e4"
/>

- Ran the replay test script after the fix introduced in this PR and
noticed:
<img width="911" height="99" alt="image"
src="https://github.com/user-attachments/assets/ad3ff3e1-666a-49b4-bda4-e05f3412d984"
/>

In other words, the total number of our entity workflows went up after
introducing this change and thus requires a patch gate!

- we found a bug in the versioning entity workflows and this is an
effort to fix this!

- [ ] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [x] added new functional test(s)

- yes, there is a risk of NDE's happening in production but I mitigated
that risk by placing the fix against a version gate.
2025-08-05 10:45:22 -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