Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-94536

Crash when stepping up while block user writes is enabled

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: 6.0.0, 7.0.0, 8.0.0-rc0, 7.3.0
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v8.0, v7.0, v6.0
    • CAR Team 2024-09-30, CAR Team 2024-10-14
    • 2

      Block user writes is a feature that disallows any writes to a cluster. The feature was designed for use by mongosync in a C2C deployment, but is exposed to users for whatever purpose they want.

      During step up, a node performs some cleanup actions. Among these actions, it drops all temporary collections in all databases. If there is any temporary collection and writes are blocked, the operation will uassert with the error code UserWritesBlocked. This exception is not caught anywhere and crashes the server.

      Since the collection is not dropped and the flag UserWritesBlocked is persisted, any node that tries to step up crashes, even after a restart, resulting in an availability problem. The only workaround to restore node operability is to disable the feature to allow the node to step up and then re-enable it (although it needs to be understood why it is used outside of the C2C context).

      The attached reproducer patch works against master.

            Assignee:
            pol.pinol@mongodb.com Pol Pinol
            Reporter:
            aitor.esteve@mongodb.com Aitor Esteve Alvarado
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: