Remove unused vacuum-truncate-auto injection point

Поиск
Список
Период
Сортировка
Искать

Remove unused vacuum-truncate-auto injection point

От:
Sami Imseih <samimseih@gmail.com>
Дата:
Вложения:
Hi,

While looking at these injection points I noticed vacuum-truncate-auto
in vacuum_rel() can never fire:

```
    #ifdef USE_INJECTION_POINTS
        if (params.truncate == VACOPTVALUE_AUTO)
            INJECTION_POINT("vacuum-truncate-auto", NULL);
        else if (params.truncate == VACOPTVALUE_DISABLED)
            INJECTION_POINT("vacuum-truncate-disabled", NULL);
        else if (params.truncate == VACOPTVALUE_ENABLED)
            INJECTION_POINT("vacuum-truncate-enabled", NULL);
    #endif
```

truncate is a boolean and can never be VACOPTVALUE_AUTO

```
    Assert(params->truncate != VACOPTVALUE_UNSPECIFIED &&
           params->truncate != VACOPTVALUE_AUTO);
```

This looks like an oversight from 661643dedad, perhaps to mirror
index_cleanup?

```
    if (params.index_cleanup == VACOPTVALUE_AUTO)
        INJECTION_POINT("vacuum-index-cleanup-auto", NULL);
```

Small cleanup attached.

--
Sami Imseih
Amazon Web Services (AWS)

Re: Remove unused vacuum-truncate-auto injection point

От:
Michael Paquier <michael@paquier.xyz>
Дата:
Вложения:
On Fri, Aug 07, 2026 at 05:00:43PM -0500, Sami Imseih wrote:
> This looks like an oversight from 661643dedad, perhaps to mirror
> index_cleanup?
> 
> ```
>     if (params.index_cleanup == VACOPTVALUE_AUTO)
>         INJECTION_POINT("vacuum-index-cleanup-auto", NULL);
> ```
> 
> Small cleanup attached.

I am pretty sure that I have defined this one to be able to track more
easily an inconsistency if someone reworks this code, so as it becomes
possible to see if the value is set to "auto" when crossing this code
path, or at least consider if this is a good idea when doing an index
cleanup.  Leaving things as they are now is not that bad, IMO.  That's
just one opinion, I'm fine to be outvoted.
--
Michael
FAQ