True when a not-yet-processed input chunk lands at or before data this node already consumed. Applying it incrementally would feed the transform out of ascending-timestamp order (SISO) or silently skip joined rows (MIMO), so the scheduler must reset + fully replay the node instead.
| 1087 | // ascending-timestamp order (SISO) or silently skip joined rows (MIMO), so |
| 1088 | // the scheduler must reset + fully replay the node instead. |
| 1089 | static bool nodeInputRegressed(DataEngine& engine, const DerivedNode& node) { |
| 1090 | if (!node.is_mimo) { |
| 1091 | const TopicStorage* in_storage = engine.getTopicStorage(node.siso_input_topic_id); |
| 1092 | if (in_storage == nullptr) { |
| 1093 | return false; |
| 1094 | } |
| 1095 | // Walk unprocessed chunks in commit order: each must start at or after |
| 1096 | // everything fed so far (including its predecessors in this same batch). |
| 1097 | PJ::Timestamp watermark = node.siso_last_ts; |
| 1098 | for (const TopicChunk& chunk : in_storage->sealedChunks()) { |
| 1099 | if (chunk.id <= node.last_processed_chunk_id || chunk.stats.row_count == 0) { |
| 1100 | continue; |
| 1101 | } |
| 1102 | if (chunk.stats.t_min < watermark) { |
| 1103 | return true; |
| 1104 | } |
| 1105 | watermark = std::max(watermark, chunk.stats.t_max); |
| 1106 | } |
| 1107 | return false; |
| 1108 | } |
| 1109 | for (PJ::TopicId in_tid : node.mimo_input_topic_ids) { |
| 1110 | const TopicStorage* in_storage = engine.getTopicStorage(in_tid); |
| 1111 | if (in_storage == nullptr) { |
| 1112 | continue; |
| 1113 | } |
| 1114 | for (const TopicChunk& chunk : in_storage->sealedChunks()) { |
| 1115 | // <= : the MIMO gather skips rows at the watermark timestamp, so a late |
| 1116 | // row exactly at it would otherwise be lost. |
| 1117 | if (chunk.id > node.mimo_last_chunk_id && chunk.stats.row_count > 0 && chunk.stats.t_min <= node.mimo_last_ts) { |
| 1118 | return true; |
| 1119 | } |
| 1120 | } |
| 1121 | } |
| 1122 | return false; |
| 1123 | } |
| 1124 | |
| 1125 | // --------------------------------------------------------------------------- |
| 1126 | // scheduleAll / scheduleActive |
no test coverage detected