#2159 kojira external repo timestamp check can break
Closed: Fixed 2 years ago by tkopecek. Opened 2 years ago by mikem.

The recently added external repo timestamp check compares:

  • the timestamp of the external repo
  • the event timestamp for the Koji repo that uses it

While testing this, both @mfilip and I had some trouble.

In my case, the problem was that my postgres server did not have timezone set to UTC.

It appears that if the postgres server is configured with any timezone other than UTC, then the event timestamp stored in Koji can be off by that timezone offset. UTC does not seem to be the default, and it doesn't look like our docs instruct admins to adjust this setting.

Because of this, on my system the event timestamp for the newly generated repo was still older than the timestamp reported by the external repo. This lead to a repeating cycle of regens (which would have eventually stopped after the tz offset period).

In @mfilip's case, the problem appeared to go the other way. A Koji repo that was slighly older than the external one had a newet timestamp and the regenerations did not occur (but presumably would have eventually).

Even apart from the tz issue, comparing timestamps from two different sources is potentially tricky. We don't control the construction of external repos.


I've also filed #2160 to track the time zone issue.

Metadata Update from @mikem:
- Custom field Size adjusted to None

2 years ago

Createrepo_c seems to correctly put UTC timestamp into repodata. So, only our side seems to be broken.

We are even not consistent with what we put to db. Most places uses NOW(), while setBuildTimestamp stores TIMESTAMP 'epoch' AT TIME ZONE 'utc'. I think, that correct solution would be to:

  1. update koji everywhere to ensure, that timestamps are always UTC (1.22)
  2. update docs, that this feature heavily depends on correct external repos (or disable it otherwise) (1.21)
  3. [RFE] configurable black + whitelist of external repos, which should be checked (list of globs, so e.g. fedora-* can be en/disabled)

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #2168 Merged 2 years ago