JBoss Community

Single Installation Patching

new comment by Jeff Mesnil View all comments on this document

I've been thinking about giving some history to the user to know how patching affected its installation.

The most essential info is to let him know which patches have been applied and when. When a patch is applied to the installation, I store a timestamp file in the .metadata/history/patchX.

When the user query the system, we look at the patch info service, fill the history for the CP (if it applies) and the previous CPs and one-offs (if it applies).

 

Thinking about this raises some questions about patches metadata.

 

Can we apply multiple CP one after the othe (e.g. CP for 6.0.1->6.0.2 then CP for 6.0.2->6.0.5) or can we apply only 1 CP per installation?

It's my understanding that applying a CP invalidates all the applied one-offs but I can not find this stated anywhere, am I mistaken?

 

If one-offs can only have been applied to the current CP (or the base version)., that means that in the history, only CPs have a cumulative file containing the *previous cumulative* (renaming the file to previous-cumulative makes it simpler to understand)

 

I've come up with a simple concrete example where:

- a base version has been installed

- CP patch-00-CP has been applied

- CP patch-01-CP has been applied

- one-off patch-XX-oneoff has been applied

- one-off patch-YY-oneoff has been applied

 

we end up with the following directory layout:

 

patches/

|-- patch-00-CP

|   |-- bundles

|   `-- modules

|-- patch-01-CP

|   |-- bundles

|   `-- modules

|-- patch-XX-oneoff

|   |-- bundles

|    `-- modules

|-- patch-YY-oneoff

|   |-- bundles

|    `-- modules

`-- .metadata

    |-- cumulative (file content => 'patch-01-CP')

    |-- references

    |   `-- patch-01-CP (file content => [patch-01, patch-02])

    `-- history

        |-- patch-00-CP

        |   |-- timestamp

        |   `-- misc (patch' "root" for misc content)

        |     `-- bin

        |          ` standalone.sh (file backup)

        |-- patch-01-CP

        |   |-- previous-cumulative

        |   |-- timestamp

        |   `-- misc

        |-- patch-XX-oneoff

        |   |-- timestamp

        |   `-- misc

        `-- patch-YY-oneoff

            |-- timestamp

            `-- misc

 

 

* .metadata/cumulative file correspond to the current cumulative version. If no CP have been applied (the installation is at its base version), this file does not exist.

* history/patch-00-CP has not previous-cumulative since it's been applied to base version

* .metadata/references/XXX files correspond to a given cumulative version and contains a list of the patches that have been applied on top of the CP (one per line)

* history/XXX/timestamp file contains a ISO-8601 data corresponding to the time the patch has been applied.

* history/XXX/misc is the "root" directory for backup of modified/removed misc content

 

To build the history, we have to browse:

1) the .metadata/cumulative & history/XXX/previous-cumulative to build the successive CP (if more than one can be applied)

2) the references/XXX of the current cumulative to have the history of the one-off applied patches

 

I also have a question about rollback. From the spec, I understand we want to rollback to a previous point in history. But we will not provide a way to rollback a given patch. Is that correct?

From the concrete example above, the user will not been able to rollback the patch-XX-oneoff (while keeping the patch-YY-oneoff). In order to do that, he must: 1) rollback to the point in history before the patch-XX-oneoff has been applied, 2) applies again all the patches after it.