cockroachdb / cockroachdb/cockroach

Allow users to specify a time zone when creating schedules and configuring row-level TTL

Open
#108,808 0 comments 0 reactions 0 assignees View on GitHub
C-enhancement
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

It’s difficult for users to create consistent and predictable schedules and jobs when managing applications and their clusters within a single timezone. There are use cases where the exact time for when jobs, such as Schedules and Row-level TTL, execute is critical.

CockroachDB should make it simpler for end users to create and manage their jobs by allowing them to specify a timezone other than UTC.

Examples:

```
CREATE SCHEDULE users_rides_nightly FOR CHANGEFEED
INTO 'external://kafka-sink'
WITH format=csv
RECURRING '1 0 * * *'
WITH SCHEDULE OPTIONS first_run=now,
on_execution_failure=retry,
on_previous_running=skip
cron_tz = 'America/New_York';
```

```
CREATE TABLE public.events (
id UUID NOT NULL DEFAULT gen_random_uuid(),
description STRING NULL,
inserted_at TIMESTAMP NULL DEFAULT current_timestamp():::TIMESTAMP,
crdb_internal_expiration TIMESTAMPTZ NOT VISIBLE NOT NULL DEFAULT current_timestamp():::TIMESTAMPTZ + '3 mons':::INTERVAL ON UPDATE current_timestamp():::TIMESTAMPTZ + '3 mons':::INTERVAL,
CONSTRAINT events_pkey PRIMARY KEY (id ASC)
) WITH (ttl = 'on', ttl_expire_after = '3 mons':::INTERVAL, ttl_job_cron = '@hourly', cron_tz = 'America/New_York')

```

Jira issue: CRDB-30648

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.