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

Persist subsystems and core model using the maximum defined stability

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Optional Optional
    • None
    • 28.0.0.Beta4
    • Management
    • None

      Currently, a subsystem only registers a single XMLElementWriter<SubsystemMarshallingContext>. Consequently, we must always register a writer for the minimum available stability.
      e.g.
      Subsystem "foo" defines 2 schema versions:

      • wildfly:foo:1.0
      • wildfly:foo:preview:1.0

      When registering its writer, we register the writer based on Stability of the server and the available schema versions.
      e.g.
      Stability.DEFAULT -> registers wildfly:foo:1.0 writer
      Stability.COMMUNITY -> registers wildfly:foo:1.0 writer (since there is no community-specific schema)
      Stability.PREVIEW -> register wildfly:foo:preview:1.0 writer
      Stability.EXPERIMENTAL -> registers wildfly:foo:preview:1.0 writer (since there is no experimental-specific schema)

      Unfortunately, makes it problematic to when switching from one stability level to another.
      e.g.
      If I start the server using Stability.COMMUNITY, the subsystem schema will persist as wildfly:foo:1.0.
      If I restart the server using Stability.PREVIEW, the subsystem will persist as wildfly:foo:preview:1.0.
      However, if I have not changed this subsystem's management model, I cannot simply restart the server using Stability.COMMUNITY, since the previously persistent server configuration will fail to parse because the wildfly:foo:preview:1.0 is not enabled by Stability.COMMUNITY.

      If we instead allowed subsystems to define a writer per Stability (like we already do for parsers), we could, prior to persisting a given subsystem, interrogate its management model and determine the maximal persistable stability of its defined resources/attributes. In our example, if the server is started using Stability.PREVIEW, but no preview resources and/or attributes are defined in its model, we can conclude that the foo subsystem is persistible using wildfly:foo:1.0.

      Thoughts?

              pferraro@redhat.com Paul Ferraro
              pferraro@redhat.com Paul Ferraro
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: