xiangfu0 commented on code in PR #18317:
URL: https://github.com/apache/pinot/pull/18317#discussion_r3137564802


##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/ForwardIndexConfig.java:
##########
@@ -248,6 +250,40 @@ public Map<String, Object> getConfigs() {
     return _configs;
   }
 
+  /**
+   * Curated slim serializer. See {@link IndexConfig#toJsonObject()} for the 
rationale.
+   *
+   * <p>Emits each field only when it differs from its class default. The 
three writer-version /
+   * chunk-size defaults are cluster-tunable statics, so they are read at call 
time (not captured)
+   * to keep the serialized form consistent with the live cluster default.
+   *
+   * <p>Deprecated input keys {@code chunkCompressionType} and {@code 
dictIdCompressionType} are
+   * intentionally not emitted — their getters were already {@code 
@JsonIgnore}, so the slim form
+   * matches prior behavior for those keys. The same applies to {@code 
configs}.
+   */
+  @Override
+  @JsonValue
+  public ObjectNode toJsonObject() {
+    ObjectNode node = super.toJsonObject();
+    if (_compressionCodec != null) {
+      node.put("compressionCodec", _compressionCodec.name());
+    }
+    if (_deriveNumDocsPerChunk) {
+      node.put("deriveNumDocsPerChunk", true);
+    }
+    // Read cluster-tunable statics at call time so the serialized form tracks 
the live default.
+    if (_rawIndexWriterVersion != _defaultRawIndexWriterVersion) {

Review Comment:
   This changes the persisted table-config contract from “materialize the 
effective forward-index defaults” to “re-evaluate process-local statics on 
read/write”. `ServiceStartableUtils` mutates these defaults from instance 
config at startup, so a rolling upgrade or mismatched instance configs can now 
make the same ZK payload resolve to different forward-index settings on 
different nodes. Before this PR the explicit values in ZK kept semantics stable 
across the cluster; dropping them here can silently change runtime behavior.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to