[QUEUED scylladb next] tools/scylla-sstable: dump-data: add timezone to deletion_time

9 views
Skip to first unread message

Commit Bot

<bot@cloudius-systems.com>
unread,
Aug 3, 2022, 12:18:56 PM8/3/22
to scylladb-dev@googlegroups.com, Botond Dénes
From: Botond Dénes <bde...@scylladb.com>
Committer: Botond Dénes <bde...@scylladb.com>
Branch: next

tools/scylla-sstable: dump-data: add timezone to deletion_time

Deletion time is always in UTC but whoever looks at the JSON has no way
to know that. In particular date-time parsers assume local timezone in
its absence which of course results incorrect deletion_time after
parsing.

---
diff --git a/tools/scylla-sstable.cc b/tools/scylla-sstable.cc
--- a/tools/scylla-sstable.cc
+++ b/tools/scylla-sstable.cc
@@ -327,7 +327,7 @@ class dumping_consumer : public sstable_consumer {
bool _clustering_array_created;
private:
sstring to_string(gc_clock::time_point tp) {
- return fmt::format("{:%F %T}", fmt::gmtime(gc_clock::to_time_t(tp)));
+ return fmt::format("{:%F %T}z", fmt::gmtime(gc_clock::to_time_t(tp)));
}
void write(gc_clock::duration ttl, gc_clock::time_point expiry) {
_writer.Key("ttl");

Commit Bot

<bot@cloudius-systems.com>
unread,
Aug 3, 2022, 10:26:38 PM8/3/22
to scylladb-dev@googlegroups.com, Botond Dénes
From: Botond Dénes <bde...@scylladb.com>
Committer: Botond Dénes <bde...@scylladb.com>
Branch: master
Reply all
Reply to author
Forward
0 new messages