On Wed, Jul 17, 2019 at 3:48 AM Thomas Munro <thomas.munro@gmail.com> wrote:
>
> On Tue, Jul 16, 2019 at 11:33 PM Dilip Kumar <dilipbalaut@gmail.com> wrote:
> > On Mon, Jul 1, 2019 at 1:24 PM Thomas Munro <thomas.munro@gmail.com> wrote:
> > /* If we discarded everything, the slot can be given up. */
> > + if (entirely_discarded)
> > + free_undo_log_slot(slot);
> >
> > I have noticed that when the undo log was detached and it was full
> > then if we discard complete log we release its slot. But, what is
> > bothering me is should we add that log to the free list? Or I am
> > missing something?
>
> Stepping back a bit: The free lists are for undo logs that someone
> might want to attach to and insert into. If it's full, we probably
> can't insert anything into it again (well, technically someone else
> who wants to insert something a bit smaller might be able to, but
> that's not an interesting case to worry about). So it doesn't need to
> go back on a free list, but it still needs to exist (= occupy a slot)
> as long as there is undiscarded data in it, because that data is
> needed and we need to be able to test URPs against its discard
> pointer. But once its data is entirely discarded, it ceases to exist
> -- there is no reason to waste a slot on it,
Right, actually I got that point. But, I was thinking that we are
wasting one logno from undo log addressing space no?. Instead, if we
can keep it attached to the slot and somehow manage to add to the free
list then the same logno can be used by someone else?
--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com