Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2267

AbstractRelNode.getId() may produce duplicate IDs in multi-threaded environment

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.17.0
    • core
    • None

    Description

      RelOptNode.getId() is supposed to be unique per instance; however, the generation of AbstractRelNode.id is not thread safe; in a multithreaded environment, the behavior is undeterministic, and there is a non-trivial possibility that duplicate IDs are generated for different nodes.

      This ID is used for comparing nodes in several places, therefore it may affect program stability and correctness. For example, if we set id=0 for all nodes, Calcite's own test suite will have multiple failures. 

      In our own test environment, the optimizers are expected to be deterministic, yet occasionally they mysteriously produce different plans. While we cannot be 100% sure that it is caused by AbstractRelNode.id, we can verify that fudging with the ID will reliably change the output of our optimizers.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            julianhyde Julian Hyde
            zhong.j.yu Zhong Yu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment