Re: Add a write_to_file member to PgStat_KindInfo

2024-11-21 Thread Michael Paquier
On Thu, Nov 21, 2024 at 12:57:18PM -0500, Yogesh Sharma wrote: > Thanks for patch. I have tested both patches and they work as per design. I've missed your message, sorry about that. -- Michael signature.asc Description: PGP signature

Re: Add a write_to_file member to PgStat_KindInfo

2024-11-21 Thread Michael Paquier
On Thu, Nov 21, 2024 at 08:49:13AM +, Bertrand Drouvot wrote: > On Thu, Nov 21, 2024 at 10:38:28AM +0300, Nazir Bilal Yavuz wrote: >> -if (!info || !info->fixed_amount) >> +/* skip if not fixed or this kind does not want to write to the >> file */ >> +if (!info || !info

Re: Add a write_to_file member to PgStat_KindInfo

2024-11-21 Thread Yogesh Sharma
Hi, Thanks for patch. I have tested both patches and they work as per design. My +1 for v1, it is much cleaner approach and has properly named functions whereas in v2 it is not. Injection points is documented, if so, doc patch is missing. Regards, Yogesh On 11/20/24 12:13, Bertrand Drouvot

Re: Add a write_to_file member to PgStat_KindInfo

2024-11-21 Thread Bertrand Drouvot
Hi, On Thu, Nov 21, 2024 at 10:01:07AM +0900, Michael Paquier wrote: > On Wed, Nov 20, 2024 at 05:13:18PM +, Bertrand Drouvot wrote: > > I don't have a strong opinion for this particular case here (I think the > > code > > is harder to read but yeah there is some code reduction): so I'm fine

Re: Add a write_to_file member to PgStat_KindInfo

2024-11-21 Thread Bertrand Drouvot
Hi, On Thu, Nov 21, 2024 at 04:26:47PM +0900, Michael Paquier wrote: > On Thu, Nov 21, 2024 at 06:32:03AM +, Bertrand Drouvot wrote: > > That was in fact the main reason why I added this test. But well, just > > adding the "write_to_file" in the injection test is enough to "show" that > > th

Re: Add a write_to_file member to PgStat_KindInfo

2024-11-21 Thread Bertrand Drouvot
Hi, On Thu, Nov 21, 2024 at 10:38:28AM +0300, Nazir Bilal Yavuz wrote: > Hi, > > On Thu, 21 Nov 2024 at 09:32, Bertrand Drouvot > wrote: > > That was in fact the main reason why I added this test. But well, just > > adding the "write_to_file" in the injection test is enough to "show" that > > t

Re: Add a write_to_file member to PgStat_KindInfo

2024-11-20 Thread Nazir Bilal Yavuz
Hi, On Thu, 21 Nov 2024 at 09:32, Bertrand Drouvot wrote: > That was in fact the main reason why I added this test. But well, just > adding the "write_to_file" in the injection test is enough to "show" that this > member does exist. So I'm fine with v3. I think that the changes below (write_to_f

Re: Add a write_to_file member to PgStat_KindInfo

2024-11-20 Thread Michael Paquier
On Thu, Nov 21, 2024 at 06:32:03AM +, Bertrand Drouvot wrote: > That was in fact the main reason why I added this test. But well, just > adding the "write_to_file" in the injection test is enough to "show" that this > member does exist. So I'm fine with v3. Plus/minus some tweaks in the wordi

Re: Add a write_to_file member to PgStat_KindInfo

2024-11-20 Thread Michael Paquier
On Wed, Nov 20, 2024 at 05:13:18PM +, Bertrand Drouvot wrote: > I don't have a strong opinion for this particular case here (I think the code > is harder to read but yeah there is some code reduction): so I'm fine with > v2 too. Well, I like the enthusiasm of having tests, but injection_points

Re: Add a write_to_file member to PgStat_KindInfo

2024-11-20 Thread Bertrand Drouvot
Hi, On Wed, Nov 20, 2024 at 05:45:55PM +0300, Nazir Bilal Yavuz wrote: > I think this is a good idea. +1 for the $SUBJECT. Thanks for looking at it! > There are duplicated codes in the injection_stats_fixed.c file. Do you > think that 'modifying existing functions to take an argument to > differ

Re: Add a write_to_file member to PgStat_KindInfo

2024-11-20 Thread Nazir Bilal Yavuz
Hi, Thank you for working on this! On Wed, 20 Nov 2024 at 17:05, Bertrand Drouvot wrote: > > Hi hackers, > > Working on [1] produced the need to give to the statistics the ability to > decide whether or not they want to be written to the file on disk. > > Indeed, there is no need to write the pe