<div dir="ltr">Point definitely well made. I'm with you now. :)<div><br></div><div>Now this being the case. I can't just swap the location. This is where I would need a rock solid upgrade hook. But I would only need to run it the once. Any suggestions? Or any good examples?</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 28, 2016 at 1:54 PM Kyle Fazzari <<a href="mailto:kyle.fazzari@canonical.com">kyle.fazzari@canonical.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
<br class="gmail_msg">
On 10/27/2016 11:27 PM, Didier Roche wrote:<br class="gmail_msg">
> Le 27/10/2016 à 19:00, Aaron Ogle a écrit :<br class="gmail_msg">
>> On Thu, Oct 27, 2016 at 11:56 AM Kyle Fazzari<br class="gmail_msg">
>> <<a href="mailto:kyle.fazzari@canonical.com" class="gmail_msg" target="_blank">kyle.fazzari@canonical.com</a> <mailto:<a href="mailto:kyle.fazzari@canonical.com" class="gmail_msg" target="_blank">kyle.fazzari@canonical.com</a>>> wrote:<br class="gmail_msg">
>><br class="gmail_msg">
>><br class="gmail_msg">
>> So are you storing this database in $SNAP_COMMON? Because<br class="gmail_msg">
>> $SNAP_DATA would do this for you, no?<br class="gmail_msg">
>><br class="gmail_msg">
>><br class="gmail_msg">
>> Correct we are doing in $SNAP_COMMON. Is $SNAP_DATA using CoW? Or is<br class="gmail_msg">
>> it going to be a full copy. From what I could see it was a full<br class="gmail_msg">
>> copy. This would quickly add up. Not to mention you loose all of our<br class="gmail_msg">
>> messages sent when you roll back.<br class="gmail_msg">
<br class="gmail_msg">
No, you're correct-- it's a full copy. But ...<br class="gmail_msg">
<br class="gmail_msg">
> I would suggest to use $SNAP_DATA. Once we have garbage collection<br class="gmail_msg">
> enabled on snapd, you will have approx. 2 copies at most of your data<br class="gmail_msg">
> (the old version and the current one). I guess this is a reasonable<br class="gmail_msg">
> tradeoff to ensure you can always revert safely.<br class="gmail_msg">
<br class="gmail_msg">
This ^^ . Note that garbage collection is in place today: snapd will<br class="gmail_msg">
begin pruning revisions once you have three of them, i.e. you will have<br class="gmail_msg">
only the three most recent revisions taking up space.<br class="gmail_msg">
<br class="gmail_msg">
> Imagine the case if a new version corrupts your data. You will not have<br class="gmail_msg">
> any way to retrieve them back if you store in $SNAP_COMMON, whichever<br class="gmail_msg">
> downgrade scripts you are writing…<br class="gmail_msg">
><br class="gmail_msg">
> So, I would argue to try $SNAP_DATA first, and then only revisit to move<br class="gmail_msg">
> to $SNAP_COMMON if you see that doesn't suit you.<br class="gmail_msg">
<br class="gmail_msg">
I second this. Note that the ability to revert is not necessarily<br class="gmail_msg">
something that should be exercised a week after using the new version<br class="gmail_msg">
("Nah, the other one was prettier. Revert!") simply because of the<br class="gmail_msg">
limitation you pointed out. It's better used with "Uh oh, my web server<br class="gmail_msg">
isn't coming up with this version. Revert!" or "Uh oh, my database<br class="gmail_msg">
migration failed. Revert!"<br class="gmail_msg">
<br class="gmail_msg">
Of course, nothing says it can't be used that way, but then you run into<br class="gmail_msg">
the limitations of the facilities provided by snapd, and you need to<br class="gmail_msg">
start hosting your data in a version-agnostic area (like you're doing).<br class="gmail_msg">
Which has its risks, as Didier pointed out.<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Kyle Fazzari (kyrofa)<br class="gmail_msg">
Software Engineer<br class="gmail_msg">
Canonical Ltd.<br class="gmail_msg">
<a href="mailto:kyle@canonical.com" class="gmail_msg" target="_blank">kyle@canonical.com</a><br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Snapcraft mailing list<br class="gmail_msg">
<a href="mailto:Snapcraft@lists.snapcraft.io" class="gmail_msg" target="_blank">Snapcraft@lists.snapcraft.io</a><br class="gmail_msg">
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/snapcraft" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.ubuntu.com/mailman/listinfo/snapcraft</a><br class="gmail_msg">
</blockquote></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">
<div><br></div><div><table border="0" cellspacing="0" cellpadding="0" style="color:rgb(0,0,0);font-family:verdana;font-size:medium">
<tbody>
<tr>
<td style="padding-right:15px">
<img src="https://cdn-download.rocket.chat/email-signature.png?v=3" style="width: 80px; display: block; margin-left: 10px;">
</td>
<td valign="top" style="padding-left:15px;border-left-width:1px;border-left-style:solid;border-left-color:rgb(240,240,240)">
<table width="100%" border="0" cellspacing="0" cellpadding="3" style="border-collapse:collapse;font-size:12px;margin-top:4px">
<tbody>
<tr>
<td style="padding:3px 0px 10px;margin:0px;font-family:verdana,geneva,sans-serif;font-size:12px;color:rgb(86,97,120)">
<b style="display:block;font-size:12px">Aaron Ogle</b>
<span style="color:rgb(153,153,153);font-size:10px;display:block">Core Developer</span>
</td>
</tr>
<tr>
<td style="padding:0px 0px 2px;margin:0px">
<p style="margin:0px;padding:0px"><a href="mailto:aaron.ogle@rocket.chat" style="color:rgb(156,160,172);font-size:10px" target="_blank">aaron.ogle@rocket.chat</a></p>
</td>
</tr>
<tr>
</tr>
<tr>
<td style="padding:0px 0px 2px;margin:0px">
<p style="margin:0px;padding:0px"><a href="https://demo.rocket.chat/direct/aaron.ogle" style="color:rgb(156,160,172);font-size:10px" target="_blank">@aaron.ogle</a></p>
</td>
</tr>
<tr>
<td style="padding:0px 0px 2px;margin:0px">
<p style="margin:0px;padding:0px"><a href="https://rocket.chat" style="color:rgb(156,160,172);font-size:10px" target="_blank">https://rocket.chat</a></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table></div>
</div></div>