Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.18.0
Description
If mini-batch is enabled currently, and if the aggregated result is the same as the previous output, this current aggregation result will not be sent downstream. This will cause downstream nodes to not receive updated data. If there is a TTL set for states at this time, the TTL of downstream will not be updated either.
The specific logic is as follows.
if (!equaliser.equals(prevAggValue, newAggValue)) { // new row is not same with prev row if (generateUpdateBefore) { // prepare UPDATE_BEFORE message for previous row resultRow .replace(currentKey, prevAggValue) .setRowKind(RowKind.UPDATE_BEFORE); out.collect(resultRow); } // prepare UPDATE_AFTER message for new row resultRow.replace(currentKey, newAggValue).setRowKind(RowKind.UPDATE_AFTER); out.collect(resultRow); } // new row is same with prev row, no need to output
When mini-batch is not enabled, even if the aggregation result of this time is the same as last time, new results will still be sent if TTL is set.
if (stateRetentionTime <= 0 && equaliser.equals(prevAggValue, newAggValue)) { // newRow is the same as before and state cleaning is not enabled. // We do not emit retraction and acc message. // If state cleaning is enabled, we have to emit messages to prevent too early // state eviction of downstream operators. return; } else { // retract previous result if (generateUpdateBefore) { // prepare UPDATE_BEFORE message for previous row resultRow .replace(currentKey, prevAggValue) .setRowKind(RowKind.UPDATE_BEFORE); out.collect(resultRow); } // prepare UPDATE_AFTER message for new row resultRow.replace(currentKey, newAggValue).setRowKind(RowKind.UPDATE_AFTER); }
Therefore, based on the consideration of TTL scenarios, I believe that when mini-batch aggregation is enabled, new results should also output when the aggregated result is the same as the previous one.
Attachments
Issue Links
- links to