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


##########
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:
   Customers will see these two messages when they create a table, so maybe we 
can say what goes wrong and how to fix it, something like below. Take your call 
on the wording.
   
   ```
   Partial upsert cannot be used with pauseless consumption. If a segment is 
recovered after a failure, merged values can change. Set upsertConfig.mode to 
FULL or ingestionConfig.streamIngestionConfig.pauselessConsumptionEnabled to 
false
   ```
   ```
   dropOutOfOrderRecord cannot be used with pauseless consumption. If a segment 
is recovered after a failure, different records can be dropped. Set 
upsertConfig.dropOutOfOrderRecord or 
ingestionConfig.streamIngestionConfig.pauselessConsumptionEnabled to false
   ```
   



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