Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-9334

Returning null from a trigger does not abort the write

    XMLWordPrintableJSON

    Details

    • Severity:
      Normal

      Description

      The javadoc for ITrigger seems to indicate that returning null means no mutations for the write will be applied at all:

           * Called exactly once per CF update, returned mutations are atomically updated.
           *
           * @param key - Row Key for the update.
           * @param update - Update received for the CF
           * @return modifications to be applied, null if no action to be performed.
      

      and indeed, TriggerExecutor.execute seems to have code for this:

              if (augmentedMutations == null)
                  return null;
      

      but it never fires. In testing with a trigger that always returns null, the original mutation is still applied.

        Attachments

        1. 9334-test-trunk.txt
          2 kB
          Sam Tunnicliffe
        2. 9334-2.0.txt
          4 kB
          Sam Tunnicliffe

          Activity

            People

            • Assignee:
              samt Sam Tunnicliffe
              Reporter:
              brandon.williams Brandon Williams
              Authors:
              Sam Tunnicliffe
              Reviewers:
              Brandon Williams
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: