<div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div dir="ltr">Best regards, Tikhomirov Pavel.<br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div dir="ltr">28 мар. 2018 г. 20:36 | От: Andrew Vagin &lt;<a href="mailto:avagin@virtuozzo.com">avagin@virtuozzo.com</a>&gt; | Сообщение:<br>
</div><div dir="ltr"><br>
</div><div dir="ltr">On Mon, Mar 26, 2018 at 02:48:51PM +0300, Pavel Emelyanov wrote:<br>
</div><div dir="ltr">&gt; On 03/26/2018 02:33 PM, Pavel Tikhomirov wrote:<br>
</div><div dir="ltr">&gt; &gt; <br>
</div><div dir="ltr">&gt; &gt; <br>
</div><div dir="ltr">&gt; &gt; On 03/26/2018 02:19 PM, Pavel Emelyanov wrote:<br>
</div><div dir="ltr">&gt; &gt;&gt; On 03/26/2018 02:02 PM, Cyrill Gorcunov wrote:<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt; On Mon, Mar 26, 2018 at 01:43:11PM +0300, Pavel Emelyanov wrote:<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt; On 03/26/2018 12:16 PM, Pavel Tikhomirov wrote:<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt;&gt; On 03/26/2018 11:54 AM, Pavel Emelyanov wrote:<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt;&gt;&gt; On 03/26/2018 11:12 AM, Pavel Tikhomirov wrote:<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; Statistics for a special dump/pre-dump/restore action should be<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; collected in the images directory of these action. We need these for<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; pid-reuse detection as we need to read the stats of parent predump.<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt;&gt;&gt; What&#39;s wrong with checking pid-reuse form stats sitting in workdir?<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt;&gt;<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt;&gt; We can read previous dump statistics from workdir before<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt;&gt; cr_*dump_finish, I agree with that, it is easy.<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt;&gt;<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt;&gt; But Kirill says that &quot;writing image outside of image directory is<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt;<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt; Stats file is not an image. We just use PB format for it and reuse existing<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;&gt; image-writing machinery.<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt;<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt; Stats file is context dependant and logically bound to images. At least<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt; keeping it inside image drectory gives you confidence the data written<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt; there belongs exactly to the images produced.<br>
</div><div dir="ltr">&gt; &gt;&gt;<br>
</div><div dir="ltr">&gt; &gt;&gt; So are logs, but we keep them in workdir anyway.<br>
</div><div dir="ltr">&gt; &gt;&gt;<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt; Because pid reuse uses<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt; data from stats to operate on memory engine it become not longer<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt; a random stat just to view, but mandatory data required for proper<br>
</div><div dir="ltr">&gt; &gt;&gt;&gt; restore.<br>
</div><div dir="ltr">&gt; &gt;&gt;<br>
</div><div dir="ltr">&gt; &gt;&gt; I&#39;ve missed that fast somehow. What&#39;s there in stats image the pid-reuse needs?<br>
</div><div dir="ltr">&gt; &gt; <br>
</div><div dir="ltr">&gt; &gt; StatsEntry-&gt;dump-&gt;dump_uptime<br>
</div><div dir="ltr">&gt; <br>
</div><div dir="ltr">&gt; Ah. I see. So, first of all, TIMING_whatever is not about time-stamps, it&#39;s about<br>
</div><div dir="ltr">&gt; &quot;time taken to perform some action&quot;. Uptime doesn&#39;t fit into this and should not<br>
</div><div dir="ltr">&gt; have been added there. Next, as a dumping ground for various dump-related stuff<br>
</div><div dir="ltr">&gt; we traditionally use the inventory.img. And last, to detect pid-reuse you do not<br>
</div><div dir="ltr">&gt; want to have the uptime of the whole system in the iamges :) You want the time the<br>
</div><div dir="ltr">&gt; process has been alive for.<br>
</div><div dir="ltr"><br>
</div><div dir="ltr">It is a good idea.<br>
</div><div dir="ltr"><br>
</div><div dir="ltr">&gt; This time is more valuable, as we currently have a bug <br>
</div><div dir="ltr">&gt; with oracle restore -- &quot;time alive&quot; gets re-set to zero upon restore and oracle kills<br>
</div><div dir="ltr">&gt; all its kids. Had we this time and the ability to ... restore it somehow (time<br>
</div><div dir="ltr">&gt; namespace might be helpful) we&#39;d solve it.<br>
</div><div dir="ltr"><br>
</div><div dir="ltr">In this context, if a process died and then it was restored, this should be<br>
</div><div dir="ltr">detected as pid-reuse.<br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div dir="ltr">Time process has been alive is not enough for pid reuse detection, uptime or time between iterations is a must. Talked with Pavel - we decided to move uptime to inventory image and make inventory image be saved on pre-dump.</div>