Re: Unnecessary static variable?

2018-01-18 Thread Antonin Houska
Tom Lane wrote: > Antonin Houska writes: > > Tom Lane wrote: > >> At one time, I think, readLen told how much data in readBuf was > >> actually valid. It seems not to be used for that anymore, but > >> I don't much like the idea that

Re: Unnecessary static variable?

2018-01-17 Thread Tom Lane
Antonin Houska writes: > Tom Lane wrote: >> At one time, I think, readLen told how much data in readBuf was >> actually valid. It seems not to be used for that anymore, but >> I don't much like the idea that readBuf is only partially filled >> but there is

Re: Unnecessary static variable?

2018-01-17 Thread Antonin Houska
Tom Lane wrote: > Antonin Houska writes: > but your patch also does this: Yes, that should have been a separate diff. > > *** retry: > > *** 11648,11654 > > } > > > > pgstat_report_wait_start(WAIT_EVENT_WAL_READ); > > ! if

Re: Unnecessary static variable?

2018-01-17 Thread Tom Lane
Antonin Houska writes: > While reading XLogPageRead() I was surprised that readLen variable is set but > not used in the read() call. Then I realized that it's declared static > although no other function uses it. Maybe it was used earlier to exit early if > sufficient amount of

Unnecessary static variable?

2018-01-17 Thread Antonin Houska
While reading XLogPageRead() I was surprised that readLen variable is set but not used in the read() call. Then I realized that it's declared static although no other function uses it. Maybe it was used earlier to exit early if sufficient amount of data was already read? I think this case is now