Github user dawidwys commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4195#discussion_r124496350
  
    --- Diff: 
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/AbstractKeyedCEPPatternOperator.java
 ---
    @@ -270,10 +270,12 @@ private void updateLastSeenWatermark(long timestamp) {
        }
     
        private void updateNFA(NFA<IN> nfa) throws IOException {
    -           if (nfa.isEmpty()) {
    -                   nfaOperatorState.clear();
    -           } else {
    -                   nfaOperatorState.update(nfa);
    +           if (nfa.isNFAChanged()) {
    +                   if (nfa.isEmpty()) {
    +                           nfaOperatorState.clear();
    +                   } else {
    +                           nfaOperatorState.update(nfa);
    --- End diff --
    
    Hmm, right we do access it from `StateBackend` each time. Not sure though 
if each time it is deserialized. I don't think there is such assumption. @kl0u 
could you shed some more light on it?
    
    If I am right and it is not deserialized each time, I would reset the 
`nfaChanged` before writing it into the `StateBackend`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to