<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Single Installation Patching
</h3>
<span style="margin-bottom: 10px;">
new comment by <a href="https://community.jboss.org/people/jmesnil">Jeff Mesnil</a> <a href="https://community.jboss.org/docs/DOC-47500#comment-10899">View all comments on this document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>I've been thinking about giving some history to the user to know how patching affected its installation.</p><p>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.</p><p>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).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p> Thinking about this raises some questions about patches metadata.</p><p>  </p><p>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?</p><p>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?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>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)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p> I've come up with a simple concrete example where:</p><p>- a base version has been installed</p><p>- CP patch-00-CP has been applied</p><p>- CP patch-01-CP has been applied</p><p>- one-off patch-XX-oneoff has been applied</p><p>- one-off patch-YY-oneoff has been applied</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>we end up with the following directory layout:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>patches/</p><p>|-- patch-00-CP</p><p>|   |-- bundles</p><p>|   `-- modules</p><p>|-- patch-01-CP</p><p>|   |-- bundles</p><p>|   `-- modules</p><p>|-- patch-XX-oneoff</p><p>|   |-- bundles</p><p>|    `-- modules</p><p>|-- patch-YY-oneoff</p><p>|   |-- bundles</p><p>|    `-- modules</p><p>`-- .metadata</p><p>    |-- cumulative (file content => 'patch-01-CP')</p><p>    |-- references</p><p>    |   `-- patch-01-CP (file content => [patch-01, patch-02])</p><p>    `-- history</p><p>        |-- patch-00-CP</p><p>        |   |-- timestamp</p><p>        |   `-- misc (patch' "root" for misc content)</p><p>        |     `-- bin</p><p>        |          ` standalone.sh (file backup)</p><p>        |-- patch-01-CP</p><p>        |   |-- previous-cumulative</p><p>        |   |-- timestamp</p><p>        |   `-- misc</p><p>        |-- patch-XX-oneoff</p><p>        |   |-- timestamp</p><p>        |   `-- misc</p><p>        `-- patch-YY-oneoff</p><p>            |-- timestamp</p><p>            `-- misc</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>* .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.</p><p>* history/patch-00-CP has not previous-cumulative since it's been applied to base version</p><p>* .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)</p><p>* history/XXX/timestamp file contains a ISO-8601 data corresponding to the time the patch has been applied.</p><p>* history/XXX/misc is the "root" directory for backup of modified/removed misc content</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>To build the history, we have to browse:</p><p>1) the .metadata/cumulative & history/XXX/previous-cumulative to build the successive CP (if more than one can be applied)</p><p>2) the references/XXX of the current cumulative to have the history of the one-off applied patches</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>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? </p><p>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.</p></div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>