> On Feb 27, 2026, at 00:22, Yura Sokolov <[email protected]> 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 better reflect that?

TotalProcs is really the length of the PGPROC array in shared memory. Prepared 
transactions are not real processes; they just occupy some slots in the proc 
array. So perhaps a name like MaxPGProcSlots or MaxBackendAndPreparedSlots 
would be more 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/






Reply via email to