deepthi912 commented on code in PR #20301:
URL: https://github.com/apache/pinot/pull/20301#discussion_r4618835061


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -1321,6 +1324,32 @@ static void 
validateConsumptionDuringUpsertRevert(TableConfig tableConfig) {
         policy != null ? "parallelSegmentConsumptionPolicy " + policy : 
"allowPartialUpsertConsumptionDuringCommit");
   }
 
+  /// Rejects partial upsert and `dropOutOfOrderRecord` on a pauseless table. 
A pauseless segment is committed before it
+  /// is built, so a failed build is repaired by consuming its offsets again, 
and for these modes that second pass can
+  /// produce different rows: a partial upsert merge and an out-of-order drop 
both depend on the upsert metadata at the
+  /// time each record arrives.
+  ///
+  /// Only a new table, or an update that turns one of these combinations on, 
is rejected. An existing table that
+  /// already has the combination can still be updated.
+  @VisibleForTesting
+  static void validatePauselessUpsertModes(TableConfig tableConfig, @Nullable 
TableConfig existingTableConfig) {
+    if (!PauselessConsumptionUtils.isPauselessEnabled(tableConfig)) {
+      return;
+    }
+    UpsertConfig upsertConfig = tableConfig.getUpsertConfig();
+    boolean existingPauseless = 
PauselessConsumptionUtils.isPauselessEnabled(existingTableConfig);
+    UpsertConfig existingUpsertConfig = existingPauseless ? 
existingTableConfig.getUpsertConfig() : null;
+    if (upsertConfig.getMode() == UpsertConfig.Mode.PARTIAL) {
+      Preconditions.checkState(
+          existingUpsertConfig != null && existingUpsertConfig.getMode() == 
UpsertConfig.Mode.PARTIAL,
+          "Partial upsert is not supported for tables with pauseless 
consumption enabled");
+    }
+    if (upsertConfig.isDropOutOfOrderRecord()) {
+      Preconditions.checkState(existingUpsertConfig != null && 
existingUpsertConfig.isDropOutOfOrderRecord(),
+          "dropOutOfOrderRecord is not supported for tables with pauseless 
consumption enabled");

Review Comment:
   Thanks, updated both messages to your wording in 88b9fadeaf.



-- 
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