Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-5367

Duplicate resource error after removing a server group

    XMLWordPrintable

    Details

    • Steps to Reproduce:
      Hide

      On a domain composed by a Domain Controller (DC) and slave Host Controller (HC) managing a single server, execute the following operations:

       /host=slave/server-config=server-one/jvm=default:add()
       /server-group=main-server-group/system-property=test:add(value=true)
       /host=slave/server=server-one:stop(blocking=true)
       /host=slave/server-config=server-one:remove()
       /server-group=main-server-group:remove()
       /server-group=main-server-group:add(profile=full, socket-binding-group=full-sockets)
       /host=slave/server-config=server-one:add(group=main-server-group, socket-binding-group=full-sockets)
       /server-group=main-server-group/system-property=test:add(value=true)
      
      Show
      On a domain composed by a Domain Controller (DC) and slave Host Controller (HC) managing a single server, execute the following operations: /host=slave/server-config=server-one/jvm=default:add() /server-group=main-server-group/system-property=test:add(value=true) /host=slave/server=server-one:stop(blocking=true) /host=slave/server-config=server-one:remove() /server-group=main-server-group:remove() /server-group=main-server-group:add(profile=full, socket-binding-group=full-sockets) /host=slave/server-config=server-one:add(group=main-server-group, socket-binding-group=full-sockets) /server-group=main-server-group/system-property=test:add(value=true)
    • Workaround Description:
      Hide

      Remove the server JVM before removing the server:

      /host=slave/server-config=server-one/jvm=default:remove()

      Show
      Remove the server JVM before removing the server: /host=slave/server-config=server-one/jvm=default:remove()

      Description

      The reproducer shows a sequence of operations where a server group is completely removed and re-added later. If the server group has a server that is using its own jvm definition, when the server and server group are removed and added again, the system properties that the server group had are still shown in the internal model managed by the DC.

      This situation leads to an inconsistent state between the model persisted and the runtime model managed by the DC. The persisted model on the DC configuration (domain.xml) doesn't contain the system property at the server group, but the model managed at runtime has such an obsolete property. Read operations don't show this inconsistency.

      At this point, if we try to re-add the same system property that the server group had, we get the following error:

      [domain@localhost:9990 /] /server-group=main-server-group/system-property=test:read-resource
      {
          "outcome" => "failed",
          "failure-description" => "WFLYCTL0216: Management resource '[
          (\"server-group\" => \"main-server-group\"),
          (\"system-property\" => \"test\")
      ]' not found",
          "rolled-back" => true
      }
      
      [domain@localhost:9990 /]  /server-group=main-server-group/system-property=test:add(value=true)
      {
          "outcome" => "failed",
          "failure-description" => {"host-failure-descriptions" => {"slave" => "WFLYCTL0212: Duplicate resource [
          (\"server-group\" => \"main-server-group\"),
          (\"system-property\" => \"test\")
      ]"}},
          "rolled-back" => true,
          "result" => {}
      }
      

      Another way to verify this inconsistency is to start the server and inspect the java options passed by the HC. The obsolete property is still being used:

      ps -fea | grep java | grep server-one | grep test
      

        Attachments

          Activity

            People

            Assignee:
            yersan Yeray Borges Santana
            Reporter:
            yersan Yeray Borges Santana
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: