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