Commit 4e46433
[common] Fall back to producer timestamp when pub-sub system timestamp is
unavailable
Venice currently relies on the pub-sub system (broker) timestamp for
getPubSubMessageTime(), but this timestamp is not always available or
accurate across all pub-sub systems. Venice already embeds a reliable
producer timestamp inside every KafkaMessageEnvelope via
producerMetadata.messageTimestamp, which is always set by VeniceWriter.
This change modifies PubSubMessageDeserializer to prefer the pub-sub
system timestamp when it is available and non-zero, but fall back to the
Venice producer timestamp when the pub-sub system provides no per-message
timestamp (timestamp is null or 0).
This is a no-op for existing Kafka deployments with LOG_APPEND_TIME since
broker timestamps are always valid and non-zero. For pub-sub systems that
do not provide reliable per-message timestamps, this ensures all 35+
downstream consumers of getPubSubMessageTime() — including DIV validation,
latency metrics, heartbeat processing, and CDC events — receive a
meaningful timestamp without any individual code changes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 0be1bda commit 4e46433
File tree
3 files changed
+53
-2
lines changed- internal/venice-common/src
- main/java/com/linkedin/venice/pubsub/api
- test/java/com/linkedin/venice/pubsub/api
3 files changed
+53
-2
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
internal/venice-common/src/main/java/com/linkedin/venice/pubsub/api/PubSubMessageDeserializer.java
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
90 | | - | |
| 94 | + | |
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
| |||
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
135 | 181 | | |
136 | 182 | | |
137 | 183 | | |
| |||
0 commit comments