Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-3379

Fix couch_auth_cache reinitialization logic

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Database Core
    • Labels:
      None

      Description

      The reinitialization logic is subtle and quite silly in hindsight. This reacted badly with the PSE work that has a slight change to the order of signals (which nothing should be relying on in an async system . This simplifies and fixes the reinitialization of couch_auth_cache.

        Activity

        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit d754c8c7f7d43e6d526f800d329704e906f793f0 in couchdb's branch refs/heads/master from Paul Joseph Davis
        [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=d754c8c ]

        Fix couch_auth_cache reinitialization logic

        The couch_auth_cache process was attempting to track its various
        monitors and then based on its monitor history decide if a 'DOWN'
        message meant it should reinitialize or exit. With the new pluggable
        storage engine work there was a subtle change to monitors which ended up
        causing couch_auth_cache to receive a monitor from the file descriptor
        before it received the monitor from the database's main pid. This
        reordering was enough for couch_auth_cache to exit which ended up
        causing errors in the test suite with race conditions when the test
        tried to open an auth db before couch_auth_cache had restarted and
        created the database.

        However, if we step back and think harder, we'll never get a monitor
        message we didn't ask for so rather than attempt to track specific
        monitors we just reinitialize the cache everytime we see a 'DOWN'
        message. On the downside this means that we're clearing the cache
        multiple times per database exit, however normal operations won't have
        this issue since that database never changes and clearing the cache
        twice in the test suite is a non issue.

        COUCHDB-3379

        Show
        jira-bot ASF subversion and git services added a comment - Commit d754c8c7f7d43e6d526f800d329704e906f793f0 in couchdb's branch refs/heads/master from Paul Joseph Davis [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=d754c8c ] Fix couch_auth_cache reinitialization logic The couch_auth_cache process was attempting to track its various monitors and then based on its monitor history decide if a 'DOWN' message meant it should reinitialize or exit. With the new pluggable storage engine work there was a subtle change to monitors which ended up causing couch_auth_cache to receive a monitor from the file descriptor before it received the monitor from the database's main pid. This reordering was enough for couch_auth_cache to exit which ended up causing errors in the test suite with race conditions when the test tried to open an auth db before couch_auth_cache had restarted and created the database. However, if we step back and think harder, we'll never get a monitor message we didn't ask for so rather than attempt to track specific monitors we just reinitialize the cache everytime we see a 'DOWN' message. On the downside this means that we're clearing the cache multiple times per database exit, however normal operations won't have this issue since that database never changes and clearing the cache twice in the test suite is a non issue. COUCHDB-3379
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit d754c8c7f7d43e6d526f800d329704e906f793f0 in couchdb's branch refs/heads/COUCHDB-3378-fix-mango-full-text-detection from Paul Joseph Davis
        [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=d754c8c ]

        Fix couch_auth_cache reinitialization logic

        The couch_auth_cache process was attempting to track its various
        monitors and then based on its monitor history decide if a 'DOWN'
        message meant it should reinitialize or exit. With the new pluggable
        storage engine work there was a subtle change to monitors which ended up
        causing couch_auth_cache to receive a monitor from the file descriptor
        before it received the monitor from the database's main pid. This
        reordering was enough for couch_auth_cache to exit which ended up
        causing errors in the test suite with race conditions when the test
        tried to open an auth db before couch_auth_cache had restarted and
        created the database.

        However, if we step back and think harder, we'll never get a monitor
        message we didn't ask for so rather than attempt to track specific
        monitors we just reinitialize the cache everytime we see a 'DOWN'
        message. On the downside this means that we're clearing the cache
        multiple times per database exit, however normal operations won't have
        this issue since that database never changes and clearing the cache
        twice in the test suite is a non issue.

        COUCHDB-3379

        Show
        jira-bot ASF subversion and git services added a comment - Commit d754c8c7f7d43e6d526f800d329704e906f793f0 in couchdb's branch refs/heads/ COUCHDB-3378 -fix-mango-full-text-detection from Paul Joseph Davis [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=d754c8c ] Fix couch_auth_cache reinitialization logic The couch_auth_cache process was attempting to track its various monitors and then based on its monitor history decide if a 'DOWN' message meant it should reinitialize or exit. With the new pluggable storage engine work there was a subtle change to monitors which ended up causing couch_auth_cache to receive a monitor from the file descriptor before it received the monitor from the database's main pid. This reordering was enough for couch_auth_cache to exit which ended up causing errors in the test suite with race conditions when the test tried to open an auth db before couch_auth_cache had restarted and created the database. However, if we step back and think harder, we'll never get a monitor message we didn't ask for so rather than attempt to track specific monitors we just reinitialize the cache everytime we see a 'DOWN' message. On the downside this means that we're clearing the cache multiple times per database exit, however normal operations won't have this issue since that database never changes and clearing the cache twice in the test suite is a non issue. COUCHDB-3379
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 3f0f806e903ac334a768210a9ac4a3c7947956c7 in couchdb's branch refs/heads/COUCHDB-3378-fix-mango-full-text-detection from Paul Joseph Davis
        [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=3f0f806 ]

        Merge pull request #481 from apache/COUCHDB-3379-fix-couch-auth-cache-reinit

        Fix couch_auth_cache reinitialization logic

        Show
        jira-bot ASF subversion and git services added a comment - Commit 3f0f806e903ac334a768210a9ac4a3c7947956c7 in couchdb's branch refs/heads/ COUCHDB-3378 -fix-mango-full-text-detection from Paul Joseph Davis [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=3f0f806 ] Merge pull request #481 from apache/ COUCHDB-3379 -fix-couch-auth-cache-reinit Fix couch_auth_cache reinitialization logic
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit d754c8c7f7d43e6d526f800d329704e906f793f0 in couchdb's branch refs/heads/COUCHDB-3376-fix-mem3-shards from Paul Joseph Davis
        [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=d754c8c ]

        Fix couch_auth_cache reinitialization logic

        The couch_auth_cache process was attempting to track its various
        monitors and then based on its monitor history decide if a 'DOWN'
        message meant it should reinitialize or exit. With the new pluggable
        storage engine work there was a subtle change to monitors which ended up
        causing couch_auth_cache to receive a monitor from the file descriptor
        before it received the monitor from the database's main pid. This
        reordering was enough for couch_auth_cache to exit which ended up
        causing errors in the test suite with race conditions when the test
        tried to open an auth db before couch_auth_cache had restarted and
        created the database.

        However, if we step back and think harder, we'll never get a monitor
        message we didn't ask for so rather than attempt to track specific
        monitors we just reinitialize the cache everytime we see a 'DOWN'
        message. On the downside this means that we're clearing the cache
        multiple times per database exit, however normal operations won't have
        this issue since that database never changes and clearing the cache
        twice in the test suite is a non issue.

        COUCHDB-3379

        Show
        jira-bot ASF subversion and git services added a comment - Commit d754c8c7f7d43e6d526f800d329704e906f793f0 in couchdb's branch refs/heads/ COUCHDB-3376 -fix-mem3-shards from Paul Joseph Davis [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=d754c8c ] Fix couch_auth_cache reinitialization logic The couch_auth_cache process was attempting to track its various monitors and then based on its monitor history decide if a 'DOWN' message meant it should reinitialize or exit. With the new pluggable storage engine work there was a subtle change to monitors which ended up causing couch_auth_cache to receive a monitor from the file descriptor before it received the monitor from the database's main pid. This reordering was enough for couch_auth_cache to exit which ended up causing errors in the test suite with race conditions when the test tried to open an auth db before couch_auth_cache had restarted and created the database. However, if we step back and think harder, we'll never get a monitor message we didn't ask for so rather than attempt to track specific monitors we just reinitialize the cache everytime we see a 'DOWN' message. On the downside this means that we're clearing the cache multiple times per database exit, however normal operations won't have this issue since that database never changes and clearing the cache twice in the test suite is a non issue. COUCHDB-3379
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 3f0f806e903ac334a768210a9ac4a3c7947956c7 in couchdb's branch refs/heads/COUCHDB-3376-fix-mem3-shards from Paul Joseph Davis
        [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=3f0f806 ]

        Merge pull request #481 from apache/COUCHDB-3379-fix-couch-auth-cache-reinit

        Fix couch_auth_cache reinitialization logic

        Show
        jira-bot ASF subversion and git services added a comment - Commit 3f0f806e903ac334a768210a9ac4a3c7947956c7 in couchdb's branch refs/heads/ COUCHDB-3376 -fix-mem3-shards from Paul Joseph Davis [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=3f0f806 ] Merge pull request #481 from apache/ COUCHDB-3379 -fix-couch-auth-cache-reinit Fix couch_auth_cache reinitialization logic

          People

          • Assignee:
            Unassigned
            Reporter:
            paul.joseph.davis Paul Joseph Davis
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development