Commit Graph

244 Commits

Author SHA1 Message Date
Muneeb Ahmad
27b67bd9c8 Propagate ComputeStatus to deployment workflow (#11273)
## What changed?
Added a missing `d.syncSummary()` call in
`syncVersionDataToComputeStatus`, so it now notifies the parent
Deployment workflow after pulling a compute status from WCI.

## Why?
Without this, the pull only updates the Version workflow's own state.
The Deployment workflow (which
`ListWorkerDeployments`/`DescribeWorkerDeployment` actually read from)
is not updated, so `computeStatus` can stay permanently missing from the
API even when the data is available.

## How did you test it?
- [x] built
- [x] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)
2026-08-03 15:28:47 -07:00
Fred Tzeng
1d4be84b37 Enable standalone activity by default (#10930)
## What changed?
Flipped the activity.enableStandalone dynamic config default from false
to true in chasm/lib/activity/config.go. Since standalone activity is
now on by default (alongside the already-defaulted-true
history.enableTransitionHistory and history.enableChasm), removed the
now-redundant explicit overrides for all three settings from the
development config files: development-cass.yaml, development-sql.yaml,
and development-xdc.yaml.

## Why?
Standalone activity is ready to be on by default, so the server default
is updated to reflect that. With all three settings now defaulting to
true in code, the explicit value: true overrides in the dev configs no
longer do anything and only add noise, so they're removed to keep the
dev configs minimal and avoid drift from the code defaults.

## How did you test it?
- [X] built
- [ ] run locally and tested manually
- [X] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)
2026-07-11 04:15:55 +00:00
Roey Berman
593fdba516 Rename the dynamic config components.callbacks.allowedAddresses to callback.allowedAddresses. (#10234)
## What changed?

Use the new dynamic config instead of leaving it as a placeholder and
update its documentation.

Also bumps the server version constant to `1.32.0`. This was supposed to
be done after the `1.31.0` release and was missed.

## Why?

Remove duplication as we migrate the code to the CHASM backed
implementation.

## Potential risks

This config is only relevant for external endpoints which are
experimental or older server versions, needs to be called out in the
release notes.
2026-05-16 19:32:02 -07:00
Vladyslav Simonenko
d12d4a4bac Add local JWT development server with key generation scripts (#9647)
## What changed?
- Added `development-jwt.yaml` config that runs Temporal with JWT
authorization enabled using a JWKS file loaded from local disk. Loading
from local disk is added in
https://github.com/temporalio/temporal/pull/9590.
- Added `config/jwt/setup-keys.sh` to generate an RSA key pair and JWKS
file in `/tmp/temporal-jwt-test/`.
- Added `config/jwt/generate-token.sh` to create signed JWTs for
testing.
  - Added `make start-jwt` target.
 
## Why?
Testing JWT authentication currently requires an external identity
provider or manual key/token setup. This provides a self-contained local
workflow: `make start-jwt` generates keys automatically and starts the
server with auth enforced, and `generate-token.sh` produces tokens on
demand.

## How did you test it?
- [X] built
- [X] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)

Tested this in conjunction with
https://github.com/temporalio/temporal/pull/9582. Was able to list the
workflows by passing the token and dumping their history. When the token
is not used, the auth fails with "Request denied".

## Potential risks
Keys are stored in /tmp/temporal-jwt-test/ which is world-readable. This
is acceptable for local development but the scripts should not be used
in shared or production environments.
2026-04-15 16:26:53 -07:00
Yu Xia
6439cf4914 Replace deprecated tctl comment with temporal cli (#9789)
## What changed?
Replace deprecated tctl comment with temporal cli

## Why?
tctl is deprecated

## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks
No. This is only local test config.
2026-04-02 11:17:42 -07:00
Stephan Behnke
29a0392865 Remove Nexus feature flag (#9512)
## What changed?

Deleted `"system.enableNexus"`.

## Why?

Nexus has been GA since Dec 2024.

## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [x] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)
2026-03-13 18:50:16 +00:00
Stephan Behnke
f085da8057 Standardize YAML formatting (#9142)
## What changed?

Adds and integrates `yamlfmt` (Go-based, by Google).

Anything not annotated was changed by `yamlfmt`.

## Why?

Consistent YAML formatting. Reduce unrelated diffs caused by formatting
in PRs.

## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [x] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)
2026-02-04 23:57:24 +00:00
Stephan Behnke
e211b276ad Remove frontend.enableExecuteMultiOperation (#8818)
ExecuteMultiOperation has been GA for a while now.
2025-12-22 22:31:56 +00:00
Fred Tzeng
846ec49dfa Add dynamic config to toggle standalone activity functionality (#8796)
## What changed?
Add dynamic config to toggle standalone activity functionality.
Refactored frontend dynamic config into activity config. Removed
standalone activity dc prefix `chasm`

## Why?
We need the ability to toggle standalone activity functionality as we go
to prod. We also agreed to remove the `chasm` prefix from any chasm
originated dynamic config keys

## How did you test it?
- [X] built
- [X] run locally and tested manually
- [X] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)
2025-12-19 11:01:46 -05:00
Fred Tzeng
5a1564ee7d Change dev environment to enable chasm (#8778)
## What changed?
Change dev environment to enable Chasm

## Why?
Chasm should be enabled for development by default so devs don't have to
explicitly set the config.

## How did you test it?
- [X] built
- [X] run locally and tested manually
- [X] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)
2025-12-19 11:01:46 -05:00
Shahab Tajik
9c33cf9e21 Add revision number to Version Data (#8722)
## What changed?
Add revision number to Worker Deployment Version Data that is synced to
Task Queues.

## Why?
This allows making task queue registration also async, but more
importantly, it prevent's race conditions between concurrent
registrations, setCurrent/Ramping, drainage, and deletion.

## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks
None.
2025-12-13 05:51:54 +00:00
Shahab Tajik
5f57a81fde Add replay test for async Versioning wfs (#8721)
## What changed?
WISOTT

## Why?
Prevent incompatible changes in the future.

## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks
None
2025-12-03 14:03:30 -05:00
Alex Stanfield
70c2b81dca Update Configuration Loading (#8477)
## What Changed

This PR introduces a new `--config-file` flag (and the
`TEMPORAL_SERVER_CONFIG_FILE_PATH ` environment variable) to remove the
dependency on `dockerize` in the Temporal server Docker image.

When a configuration file is specified using either the CLI flag or the
environment variable, the server will load configuration **only** from
that file.
Users who want templating behavior similar to `dockerize` can enable it
by adding the comment `# enable-template` at the top of the
configuration file.

---

### Key Changes

1. **New `--config-file` flag:**

* Adds a global `--config-file` flag that accepts a path to a single
configuration file (absolute or relative to the project root).
* Can also be set via the `TEMPORAL_SERVER_CONFIG_FILE_PATH `
environment variable.

2. **Deprecated legacy flags:**

* The `--config`, `--env`, and `--zone` flags are now marked as
**deprecated** in CLI help text.
   * These flags still work for backward compatibility.

3. **Embedded config template:**

* The `config_template.yaml` file is now embedded in the binary to
support loading configuration from environment variables.
* Templating is supported if the file includes the `# enable-template`
comment at the top.

4. **Templating support:**

* Configuration files can use templating by including `#
enable-template` at the beginning of the YAML file.

---

### Configuration Loading Priority (Highest to Lowest)

1. **`--config-file` specified** → Load that specific file
2. **`--config`, `--env`, or `--zone` specified** → Load from
configuration directory (**deprecated**)
3. **No configuration specified** → Load from embedded template using
environment variables (default)

---

### Expected Behavior

The following examples illustrate how the new configuration loading
logic behaves:

* **Default behavior:**
Running `temporal start` without flags loads configuration from
environment variables only using the embedded template.

* **Using `--config-file`:**
`temporal --config-file=/path/to/config.yaml start` loads configuration
from the specified file path.

* **Using `TEMPORAL_SERVER_CONFIG_FILE_PATH`:**
Setting `TEMPORAL_SERVER_CONFIG_FILE_PATH=/path/to/config.yaml temporal
start` has the same effect as using the flag.

* **Validation and error handling:**
The CLI returns clear error messages when conflicting flags or
environment variables are used, or when a specified file does not exist.
---

## Breaking Change

The default behavior of `temporal start` has changed.
It now loads configuration **from environment variables** instead of
using a default template path.

---------

Co-authored-by: Alex Stanfield <chaptersix@users.noreply.github.com>
Co-authored-by: michaely520 <michaely520@users.noreply.github.com>
Co-authored-by: Yichao Yang <yichao@temporal.io>
Co-authored-by: David Reiss <david@temporal.io>
2025-11-18 16:23:25 +00:00
Roey Berman
9c8c54cc4c Add internal HTTP port in docker config templates (#8332)
## Why?

This was missed in #8327
2025-09-18 00:14:21 +00:00
Will Duan
469195575b Fix task queue grouping for replication task scheduler (#8315)
## What changed?
Add custom grouping logic at replication low priority task scheduler

## Why?
To allow custom logic to group replication task.

## How did you test it?
- [x] built
- [x] run locally and tested manually
- [x] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks
No risk.
2025-09-12 00:02:51 +00:00
Roey Berman
834aaddc49 Remove frontend.enableClientVersionCheck commented configs (#8288)
## Why?

The config was commented out in our development config files but has
been removed from the codebase since v1.18.
2025-09-05 17:39:10 +00:00
Shivam
9c48ca474e clear drainage status of a rollbacked version workflow (#8119)
## What changed?
- 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](ada5d0bbee/service/worker/workerdeployment/version_workflow.go (L546))
- note how previously, since the drainage information was not cleared,
[this](ada5d0bbee/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!

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

## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [x] added new functional test(s)

## Potential risks
- 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-07-31 20:29:35 +00:00
Roey Berman
690c1f8380 Delete config overrides for eager workflow start (#8054)
Follow up to #8048
2025-07-16 18:26:05 +00:00
Adam Horacek
943d5b3d8e Support for regex pattern in DefaultJWTClaimMapper permission parser (#7574)
## What changed?
Added support for parsing permissions from JWT claim using regular
expression

## Why?
Default JWT Claim Mapper expects permission in form `namespace:role`. If
it's not possible to configure JWT issuer to follow `namespace:role`
permissionsPattern can be set to regular expression with named groups to
parse permission. More details in issue gh-7560

## How did you test it?
- Unit tests
- Local tests
- Self hosted environment (ongoing)

## Potential risks
This change is only activated if new configuration is provided

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->
WIP

## Is hotfix candidate?
No
2025-07-07 09:33:07 -07:00
Yuri
2ac732f836 remove feature flag for activity commands (#7879)
## What changed?
Enable activity commands - remove feature flag.

## Why?
preparing for GA

## How did you test it?
- [X] built
- [X] run locally and tested manually
- [X] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)
2025-06-06 13:39:11 -07:00
Chetan Gowda
f6d6e5d9f1 Implement statsd exporter for otel (#7827) 2025-05-29 19:18:49 -07:00
Yuri
52793d92f8 Add flag to restore activity options to reset and update (#7824)
## What changed?
Added support for flags to restore activity options to reset activity
and update activity commands.

## Why?
Users should be able to reset/restore activity options.

## How did you test it?
- [X] built
- [X] run locally and tested manually
- [X] covered by existing tests
- [X] added new unit test(s)
- [X] added new functional test(s)
2025-05-29 08:31:24 -07:00
Rodrigo Zhou
f103ff4508 Support add search attribute in dual visibility (#7781) 2025-05-23 21:54:59 +00:00
Yichao Yang
691ae07acc Enable transition history in dev env and tests (#7737)
## What changed?
- Enable transition history in dev env and tests
- Reset state transition count when reporting nexus operation completion to a reset run

## Why?
- Exercise transition history and state-based replication path more
often
- Make chasm development and testing easier since it relies on
transition history

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [x] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)
2025-05-08 15:23:24 -07:00
Rob Holland
63e79f4bbc Add support for templating in configs (#6251)
## What changed?

Support for text/template was added to the config loading system. Sprig
is used for some useful templating functions, as used by dockerize and
helm.

## Why?

This avoids the need to use dockerize to render config templates when
deploying in containers. Without the need to write the intermediate
config to disk, the image can be immutable. Any volumes used to copy
over an alternative template can be read-only also, enabling more secure
deployment.

## How did you test it?

Built a `FROM scratch` image using the updated temporal-server binary
and confirmed that it would work when deployed using (slightly adjusted)
version of our helm charts.

## Potential risks

None.

## Documentation

Documentation should be updated to explain this new feature, but given
it's so close to the standard deployment setup with dockerize, this
doesn't need to block release of the feature imho.

## Is hotfix candidate?
No

---------

Co-authored-by: David Reiss <david@temporal.io>
2025-04-01 08:14:41 +01:00
Yichao Yang
9fcb27b76e Enable execution timeout timer by default (#7457)
## What changed?
<!-- Describe what has changed in this PR -->
- Enable execution timeout timer by default

## Why?
<!-- Tell your future self why have you made these changes -->
- it's been several server releases since this feature is merged, it's
safe to enable it by default now without any backward compatibility
concerns
- Will remove the flag after next oss release if not issue reported
about it.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
- Existing tests

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
- Very low. Already enabled in all production envs

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
2025-03-21 17:44:21 -07:00
Shivam
114e881a0a versioning-3.1: better replay tester (#7484)
## What changed?
<!-- Describe what has changed in this PR -->
- A better more robust replay tester covering the different API's made
possible in worker-versioning 3.1

## Why?
<!-- Tell your future self why have you made these changes -->
- To ensure that NDE changes made in these entity wf's can be caught in
the near future

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
- These are tests

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
2025-03-19 15:44:23 -04:00
Shahab Tajik
0883ca2e31 Keep syncing User Data as long as version changes (#7320)
## What changed?
<!-- Describe what has changed in this PR -->

UserDataManger in child partitions constantly fetches data from the
parent partition. There is a safely mechanism to prevent busy loop in
case the parent returns result immediately instead of only when the data
is updated.
The safety mechanism did not work well with Versioning 3 because many
updates are involved in a single tests. With this update we relax the
safety check to only apply when the user data version remains the same
and continue to fetch the data asap as long as each time it gets new
data.

Here, also I'm relaxing the "requested task queue user data for version
greater than known version" errors to be thrown only for the root
partition, as they can normally happen for child partitions.

## Why?
<!-- Tell your future self why have you made these changes -->
So that back-to-back Versioning 3 APIs do not have to wait for a long
time.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
Existing tests.

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
Yes.
2025-02-12 17:12:56 -08:00
Shahab Tajik
bac1fa29b9 Bump nexus-rpc/sdk-go tag to v0.2.0 (#7288)
## What changed?
<!-- Describe what has changed in this PR -->
The lib version accidentally went back in a previous PR. Fixing it here.

## Why?
<!-- Tell your future self why have you made these changes -->

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
2025-02-07 02:24:44 +00:00
Carly de Frondeville
87ce207b6e Worker Deployment Version Drainage Status (#7158)
## What changed?
Add DrainageStatus child workflow to worker deployment system

## Why?
To periodically update the version workflow with results from
visibility.

## How did you test it?
Functional tests. Currently broken (see todo comment in code)

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->

---------

Co-authored-by: Shivam Saraf <shivam.saraf@temporal.io>
2025-02-06 15:41:35 -08:00
Kevin Woo
ef9c2e6e1f readme: fix formatting (#6775)
## What changed?
Fixed README formatting

## Why?
It didn't render correctly, which made it confusing to read.

## How did you test it?
n/a

## Potential risks
n/a

## Documentation


## Is hotfix candidate?
No
2024-11-07 16:22:05 -08:00
Stephan Behnke
9753623e31 Enable Update Workflow by default (#6385)
## What changed?
<!-- Describe what has changed in this PR -->

Enable Update Workflow (sync and async) by default.

Note that I'm leaving the flag and the code checks for now, in case we
need to disable it again.

## Why?
<!-- Tell your future self why have you made these changes -->

For public preview.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
2024-08-08 14:27:00 -07:00
Hazel Kim
03e316fa0d modified ES visibility store to support custom visibility store (#6168)
## What changed?
<!-- Describe what has changed in this PR -->
- changed ES visibilityStore struct and some of its functions to public
- added namespaceRegistry, searchAttributesProvider,
searchAttributesMapperProvider arguments to custom visibility store
factory interface
- added field `closeTime` in DeleteExecutionVisibilityTask

## Why?
<!-- Tell your future self why have you made these changes -->

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
2024-07-10 09:25:31 -04:00
pdoerner
3a6bdc127a Add dynamic config for callback endpoint config (#6204)
## What changed?
<!-- Describe what has changed in this PR -->
Added a new per-namespace dynamic config for allowed callback addresses.
This dynamic config is a list of maps that currently supports two
entries:
* `Pattern:string` The host:port that this rule applies to. It is a
pattern because wildcard (`*`) matching is supported.
* `AllowInsecure:bool` Indicates whether `https` is required for this
address.

Added validation when processing StartWorkflow requests to ensure that
any attached callback URLs have a matching allowed address entry and
that the scheme matches the `AllowInsecure` setting.

## Why?
<!-- Tell your future self why have you made these changes -->
To be able to white-list allowed callback endpoints.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
Updated functional tests.
2024-06-28 12:31:43 -07:00
Roey Berman
d9b2fe6e93 Remove /api/v1 from development DC (#6171)
We removed this prefix from all of the routes but forgot to modify the
development configs.
2024-06-19 00:06:40 +00:00
Yu Xia
ed82502a2d Add round robin on replication task execution (#6087)
## What changed?
Add round robin on replication task execution

## Why?
With multiple clusters connect together, it is possible one busy cluster
flush the replication stack and cause replication lag on other clusters.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
2024-06-07 23:16:35 +00:00
Norbert Hu
f7f605d397 Enable FE proxying history reads to history service as default (#5992)
This is a re-revert of https://github.com/temporalio/temporal/pull/5797
now that all changes moving forward will be part of 1.25 release.

## Why?
The new logic to proxy all FE history read operations to the history
service has been part of release 1.23 and it is now safe (w.r.t. FE and
history services deployment ordering) as part of release 1.25 to start
deprecating the legacy code.
2024-05-30 13:26:52 +00:00
Roey Berman
4b6d0e6a87 Properly dispatch requests for Nexus Worker Endpoints (#5997)
Also changed the semantics of cluster info's HTTPAddress to just be the
address, and not include the scheme.
We now use the TLS configuration to derive the URL scheme.
2024-05-24 18:59:25 +00:00
Hazel Kim
09cb808c4a enabled shadow read for secondary visibility store (#5976)
## What changed?
<!-- Describe what has changed in this PR -->
- added EnableShadowReadMode config (default to false)
- if shadow read mode is enabled, perform shadow read from the secondary
visibility store for visibility read requests

## Why?
<!-- Tell your future self why have you made these changes -->
- to measure latency metrics from both visibility stores

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
- tested locally, and verified that visibility read requests from both
visibility stores are getting reasonably same latencies

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
2024-05-23 18:45:58 -04:00
Prathyush PV
0f79e1845b Changing MutableState cache to host-level by default (#5894)
## What changed?
We had added a configuration flag to make MutableState cache a
host-level cache.
Changing dynamic config to enable this flag by default and adjusting
cache size to 128K. We found that this size is appropriate for most
workloads we see.

Also setting host-level cache size to be 8K in development dynamic
config.

## Why?
Host level cache is better for cache utilization and it prevents the
problem of a smaller shard-level cache getting full with pinned
elements.

## How did you test it?
Running the cluster with load.

## Potential risks
None

## Documentation

## Is hotfix candidate?
No
2024-05-21 21:21:22 +00:00
Yichao Yang
d7d6d9edb0 Properly update workflow transition history (#5885)
## What changed?
<!-- Describe what has changed in this PR -->
- Properly update workflow transition history.
- Only update transition history when closing transaction as active
- Only update updates to replicated application state as state
transition (NOTE: this is a different concept from the existing state
transition counter we have in executionInfo, which is simply how many
times the mutable state object got updated.)
    - When sub state machine tree is dirty
    - When history event got generated.
    - When there's sync activity
- All other changes are either system level field update or not
replicated (e.g. buffer events or transient workflow task)

## Why?
<!-- Tell your future self why have you made these changes -->
- State-based replication rely on all clusters agree on the same
transition history. and replication task processing logic relies on the
transition history to detect missing or conflicting state transitions.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
- Existing tests
- Added unit tests

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
- State transition history is behind a feature flag so no risk.

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->
- N/A

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
- No
2024-05-21 13:38:44 -07:00
Roey Berman
1c27937b95 Various (mostly) nexus related improvements (#5961)
- Combined all Nexus related feature flags into a single
`system.enableNexus` dynamic config.
  Dynamic configs that were _removed_ (some were namespace specific):
  - `frontend.enableNexusAPIs`
  - `frontend.enableCallbackAttachment`
  - `history.enableMutableStateTransitionHistory`
  - `history.outboundProcessorEnabled`
  - `component.nexusoperations.enabled`

- Added support for callback header attachment and propagation 
- WIP Support for `Worker` endpoint target - localhost only
- Added dynamic config for `cass` and `sql`:

  ```
  - component.nexusoperations.callback.endpoint.template:
- value:
http://localhost:7243/api/v1/namespaces/{{.NamespaceName}}/nexus/callback
  ```

- Properly handle gRPC errors coming from matching in the frontend nexus
handler
- Consider invalid Nexus responses a downstream error
- Fix panic when trying to get event ID for `StateMachineTimerTask`
(used for logging)
- Don't return `errNoRecentPoller` for nexus tasks
- Remove namespace wait in functional tests (not Nexus specific)
2024-05-21 12:21:32 -07:00
Alex Shtin
961069b99c Fault Injection: execute operation while still returning an error to the caller (#5869)
## What changed?
<!-- Describe what has changed in this PR -->
Added new fault injection error `ExecuteAndTimeout`.

While working on this, I also figured out that fault injection code
required refactoring and renames. I will do it in separate PR.

## Why?
<!-- Tell your future self why have you made these changes -->
`ExecuteAndTimeout` is a special error which emulates case, when client
got a `Timeout` error, but operation actually reached persistence and
was executed successfully.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
Run locally.

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
No risks.

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->
No.

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
No.
2024-05-07 11:43:57 -07:00
Norbert Hu
b0389a6dcd Revert "Enable FE proxying history reads to history service as default (#5736)" (#5797)
## What changed?
This reverts commit 3f1bdfba23.

## Why?
This cleanup of deprecated code must wait until v1.25+
2024-04-25 22:01:25 +00:00
Norbert Hu
3f1bdfba23 Enable FE proxying history reads to history service as default (#5736)
## Why?
The new logic to proxy all FE history read operations to the history
service has been part of release 1.23 and it is now safe (w.r.t. FE and
history services deployment ordering) as part of release 1.24 to start
deprecating the legacy code.
2024-04-18 17:20:25 +00:00
Yichao Yang
b02158316c Workflow Execution Timeout Timer (#5588)
## What changed?
<!-- Describe what has changed in this PR -->
- Add new timer task type for workflow execution timeout & carry over
execution timeout timer state across runs in a workflow chain.
- This change depends on
https://github.com/temporalio/temporal/pull/5531 so that only one timer
task will be created on the standby side as well.
- New behavior is controlled via a feature flag.

## Why?
<!-- Tell your future self why have you made these changes -->
- For a workflow chain, we only need one execution timeout timer task
for the entire chain. Before this change, each run in the chain will
create a run timeout timer. If user set runTimeout == execution timeout
(which is the default if only execution timeout is specified!), then the
timeout timer for all the runs will fire at the exact same time (because
run timeout will be shortened to respect the execution timeout). This
can result in a timer burst for a single workflowID.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
- Added unit tests
- Tested locally with cron workflows.

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
- In worst case, workflow may not timeout properly.

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->
- N/A, no change on behavior.

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
- No.
2024-04-08 11:11:24 -07:00
Dan Davison
92b1b5b7d4 Comments and docstrings (#5579)
Miscellaneous edits of comments and docstrings
2024-04-01 16:59:27 -07:00
Yichao Yang
00fab090ff Fix replication for UpdateWorkflowExecutionWithNew (#5531)
## What changed?
<!-- Describe what has changed in this PR -->
- When workflow in the source cluster completes and starts a new run in
the same transaction. Replication should also apply that in one
transaction in standby cluster. Today this only happens when the current
workflow closes with continue as new event, but there are other cases
like cron and retry where workflow can close with
completed/timedout/failed event and also has a new run.

## Why?
<!-- Tell your future self why have you made these changes -->
- Transactional guarantee should be preserved by replication

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
- New unit tests
- Run canary using global namespace.

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
- Replication task may go to dlq in worst case

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->
- N/A

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
- No.
2024-03-25 10:47:29 -07:00
Chetan Gowda
3b6a2dcad5 Add sampled logging when workflow query task times out (#5521)
## What changed?
Adding a sampled logging when a workflow query task times out.

## Why?
Need this to be able to debug issues in the future when workflow queries
timeout.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
2024-03-15 00:42:16 +00:00
Roey Berman
ec09daac8f Nexus accumulated work (#5225)
This PR is intended to merge 4 months of work in the `nexus` feature
branch into `main`.

The functionality it brings is:
- Dispatching Nexus Tasks by namespace and task queue
- Internal implementation of the Incoming Service Registry - not yet
exposed
- Attaching workflow close callbacks on `StartWorkflowExecutionRequest`
and processing of those callbacks

There's more to come and some of the callback code will be refactored
into a new plugin architecture
(https://github.com/temporalio/temporal/pull/5446) soon.

---------

Co-authored-by: PJ Doerner <pj.doerner@temporal.io>
2024-03-05 22:37:21 +00:00