Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-7692

affinityCall and affinityRun may execute code on backup partitions

    XMLWordPrintableJSON

Details

    Description

      Apparently, the affinityCall and affinityRun methods reserve partitions and check their state to be OWNING, however, if topology changes and partition role is changed to backup from primary, the code is still executed.

      This can be an issue if a user executes a local SQL query inside the affinityCall runnable. In this case, the query result may return null.

      This can be observed in the IgniteCacheLockPartitionOnAffinityRunTest#getPersonsCountSingleCache - note an additional check I've added to make the test pass.

      I think it is ok to have an old semantics for the API, because in some cases (scan query, local gets) a backup OWNER is enough. However, it looks like we need to add another API method to enforce that affinity run be executed on primary nodes and forbid primary role change.
      Another option is to detect a topology version of the affinity run and use that version for local SQL queries.

      Attachments

        Activity

          People

            sergey-chugunov Sergey Chugunov
            agoncharuk Alexey Goncharuk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: