Re: [HACKERS] [PATCH] pageinspect function to decode infomasks
От | Craig Ringer |
---|---|
Тема | Re: [HACKERS] [PATCH] pageinspect function to decode infomasks |
Дата | |
Msg-id | CAMsr+YGOMi+KgqU9ArkNmctS5crossszLL+pnxGGbuE2f-xWrg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] [PATCH] pageinspect function to decode infomasks ("Moon Insung" <Moon_Insung_i3@lab.ntt.co.jp>) |
Ответы |
Re: [HACKERS] [PATCH] pageinspect function to decode infomasks
|
Список | pgsql-hackers |
Dear Craig Ringer
Frist, thank you for implementing the necessary function.
but, i have some question.
question 1) vacuum freeze hint bits
If run a vacuum freeze, bits in the infomask will be 0x0300.
in this case, if output the value of informsk in the run to you modified,
HEAP_XMIN_COMMITTED(0x0100), HEAP_XMIN_INVALID(0x0200), HEAP_XMIN_FROZEN(0x0300)
all outputs to hint bits.
is it normal to output values?
if look at htup_details.h code,
#define HeapTupleHeaderXminInvalid(
tup) \ ( \
((tup)->t_infomask & (HEAP_XMIN_COMMITTED|HEAP_
XMIN_INVALID)) == \ HEAP_XMIN_INVALID \
)
#define HeapTupleHeaderSetXminCommitte
d(tup) \ ( \
AssertMacro(!
HeapTupleHeaderXminInvalid( tup)), \ ((tup)->t_infomask |= HEAP_XMIN_COMMITTED) \
)
HEAP_XMIN_INVALID and HEAP_XMIN_COMMITTED can not be write simultaneously.
question 2) xmax lock hint bits
similar to the vacuum freezeze question..
Assume that the infomask has a bit of 0x0050
In this case, if run on the code that you modified,
HEAP_XMAX_KEYSHR_LOCK(0x0010), HEAP_XMAX_EXCL_LOCK(0x0040), HEAP_XMAX_IS_LOCKED_ONLY
three hint bits are the output.
if look at htup_details.h code,
#define HEAP_XMAX_IS_SHR_LOCKED(
infomask) \ (((infomask) & HEAP_LOCK_MASK) == HEAP_XMAX_SHR_LOCK)
#define HEAP_XMAX_IS_EXCL_LOCKED(
infomask) \ (((infomask) & HEAP_LOCK_MASK) == HEAP_XMAX_EXCL_LOCK)
#define HEAP_XMAX_IS_KEYSHR_LOCKED(
infomask) \ (((infomask) & HEAP_LOCK_MASK) == HEAP_XMAX_KEYSHR_LOCK)
It is divided into to hint bits.
so I think this part needs to fix.
В списке pgsql-hackers по дате отправления: