Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear timezone semantics when used with cron #3818

Open
rzetelskik opened this issue Apr 22, 2024 · 3 comments
Open

Unclear timezone semantics when used with cron #3818

rzetelskik opened this issue Apr 22, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@rzetelskik
Copy link
Member

rzetelskik commented Apr 22, 2024

sctool and service API accept timezone flag, which, according to the docs [1][2][3], specifies the timezone of cron and window flags.

--timezone
Timezone of –cron and –window flag values. The default value is taken from this system, namely ‘TZ’ envvar or ‘/etc/localtime’ file.

Default value: UTC

However, cron also accepts the extended syntax allowing for specifying TZ=<timezone> and CRON_TZ=<timezone>. It's undocumented in scylla-manager task docs, and it's not clear what the outcome of using it is, especially when used in tandem with timezone.

For instance, it's not clear what the difference between the following would be, or what behaviour should be expected:

$ sctool repair -c=scylla/scylla --cron="0 23 * * SAT" --timezone="Europe/Warsaw"

$ sctool repair -c=scylla/scylla --cron="TZ=Europe/Warsaw 0 23 * * SAT"

$ sctool repair -c=scylla/scylla --cron="TZ=UTC 0 23 * * SAT" --timezone="Europe/Warsaw"

$ sctool repair -c=scylla/scylla --cron="TZ=Europe/Warsaw 0 23 * * SAT" --timezone="Europe/Warsaw"

$ sctool repair -c=scylla/scylla --cron="TZ=Europe/Warsaw CRON_TZ=UTC 0 23 * * SAT" --timezone="Europe/Warsaw"

I'd expect this to either be documented, or the additional syntax to be explicitly forbidden.

For reference, Kubernetes ran into a similar issue with CronJob [4], and the docs now specify that the extended syntax is not officially supported, and using the syntax results in a validation error in newer releases.

[1] - https://manager.docs.scylladb.com/stable/sctool/repair.html#timezone
[2] - https://manager.docs.scylladb.com/stable/sctool/backup.html#timezone
[3] - https://manager.docs.scylladb.com/stable/sctool/restore.html#timezone
[4] - https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#unsupported-timezone-specification

@rzetelskik
Copy link
Member Author

cc @karol-kokoszka

@rzetelskik rzetelskik changed the title Unclear timezone semantics with cron Unclear timezone semantics when used with cron Apr 22, 2024
@karol-kokoszka
Copy link
Collaborator

Candidate for 3.2.9 (or 3.3.1)

@karol-kokoszka
Copy link
Collaborator

grooming note

We must extend the documentation and explain what are the timezones that can be defined in task responsible for.
We must explain that cron specification allows to include the timezone.

We must understand how definining/not defining the timzeone in CRON impacts the scheduled task execution.
There is a timezone available for the manager overall (must be checked what is it about).
And the third timezone defines task.

So 3 timezones, per CRON, per task, per manager.

The goal of this task is to understand their meaning and impact + document them.

@karol-kokoszka karol-kokoszka added documentation Improvements or additions to documentation and removed grooming-needed labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants