Re: Fix bug in multixact Oldest*MXactId initialization and access

Поиск
Список
Период
Сортировка
От Chao Li
Тема Re: Fix bug in multixact Oldest*MXactId initialization and access
Дата
Msg-id 7D765C95-0FF5-4A7D-9C4F-B8DF0CB24906@gmail.com
обсуждение исходный текст
Ответ на Re: Fix bug in multixact Oldest*MXactId initialization and access  (Yura Sokolov <y.sokolov@postgrespro.ru>)
Ответы Re: Fix bug in multixact Oldest*MXactId initialization and access
Список pgsql-hackers

> On Feb 27, 2026, at 00:22, Yura Sokolov <y.sokolov@postgrespro.ru> wrote:
>
>
> Chao Li, new access functions doen't branch because I've made separate
> functions to store at slots for prepared transactions.
>

```
+    OldestMemberMXactId[procno - MaxChildren + MaxBackends] = mxact;
```

Wow, this is clever. It removes NUM_AUXILIARY_PROCS from procno without introducing an extra if check.

However, I am not a big fan of the new global variable names:
```
MaxChildren = MaxBackends + NUM_AUXILIARY_PROCS;
TotalProcs = MaxChildren + max_prepared_xacts;
TotalXactProcs = MaxBackends + max_prepared_xacts;
```

MaxChildren is actually the total number of backends plus auxiliary processes. Maybe something like MaxProcs would
betterreflect that? 

TotalProcs is really the length of the PGPROC array in shared memory. Prepared transactions are not real processes;
theyjust occupy some slots in the proc array. So perhaps a name like MaxPGProcSlots or MaxBackendAndPreparedSlots would
bemore accurate. 

As for TotalXactProcs, maybe something like MaxBackendAndPreparedSlots would make the intent clearer.

Anyway, I am not very good at naming things. You or others may have better suggestions.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/







В списке pgsql-hackers по дате отправления: