Re: [BUGS] 答复: [BUGS] BUG #14615: ReplicationOriginShmemInit Memory access cross-border
От | Andres Freund |
---|---|
Тема | Re: [BUGS] 答复: [BUGS] BUG #14615: ReplicationOriginShmemInit Memory access cross-border |
Дата | |
Msg-id | 20170411152214.gepn4iulxnje43t7@alap3.anarazel.de обсуждение исходный текст |
Ответ на | [BUGS] 答复: [BUGS] BUG #14615: ReplicationOriginShmemInit Memory access cross-border (shao bret <bret.shao@outlook.com>) |
Ответы |
[BUGS] 答复: [BUGS] 答复: [BUGS] BUG #14615: ReplicationOriginShmemInit Memory access cross-border
|
Список | pgsql-bugs |
On 2017-04-10 07:02:06 +0000, shao bret wrote: > Hi Michael, > Thanks for your quickly response! > I think maybe you have a little misunderstanding with my solution. > > My solution is that > if (!found) > { > int i; > MemSet(replication_states_ctl, 0, ReplicationOriginShmemSize()); > replication_states_ctl->tranche_id = LWLockNewTrancheId(); > replication_states_ctl->tranche.name = "ReplicationOrigins"; > replication_states_ctl->tranche.array_base = > &replication_states[0].lock; > replication_states_ctl->tranche.array_stride = > sizeof(ReplicationState); > > //MemSet(replication_states, 0, ReplicationOriginShmemSize()); > > for (i = 0; i < max_replication_slots; i++) > LWLockInitialize(&replication_states[i].lock, > replication_states_ctl->tranche_id); > } > So I think it’s easier for understanding code. > What do you think? That's imo just more work to maintain if additional fields added. - Andres -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs
В списке pgsql-bugs по дате отправления: