#135 Made DB name unique#137
Conversation
| now = datetime.now() | ||
| year_start = datetime(now.year, 1, 1) | ||
| minutes_elapsed = int((now - year_start).total_seconds() // 60) | ||
| random_suffix = time.time_ns() % 1048576 |
There was a problem hiding this comment.
So, we would need more or less a nanosecond collision to generate the same name. And, the minutes since year start only can collide, if instances would run for more then a year.
There was a problem hiding this comment.
Yes, I come from assumption that nobody works around Xmas/New Year time. So, a DB left from the previous year is probably stuck and should be deleted. Overall, I call the names semi-unique, but it should be unique enough for practical purposes. Also, the minute resolution should be enough to see how long a DB is running.
There was a problem hiding this comment.
I aimed to fit the changes into the same 10 characters that were previously occupied by the proper timestamp.
There was a problem hiding this comment.
Please note that this change will break some parts of our monitoring in GHA relying on the current specific timestamp format of the database names.
There was a problem hiding this comment.
Where does the magic number 1048576 come from?
There was a problem hiding this comment.
2 ** 20 that cuts off a hex number 5 characters long.
| now = datetime.now() | ||
| year_start = datetime(now.year, 1, 1) | ||
| minutes_elapsed = int((now - year_start).total_seconds() // 60) | ||
| random_suffix = time.time_ns() % 1048576 |
There was a problem hiding this comment.
Please note that this change will break some parts of our monitoring in GHA relying on the current specific timestamp format of the database names.
Co-authored-by: Christoph Kuhnke <christoph.kuhnke@exasol.com>
| now = datetime.now() | ||
| year_start = datetime(now.year, 1, 1) | ||
| minutes_elapsed = int((now - year_start).total_seconds() // 60) | ||
| random_suffix = time.time_ns() % 1048576 |
There was a problem hiding this comment.
Where does the magic number 1048576 come from?
|



closes #135