Fix representation of SORT_TYPE_STILL_IN_PROGRESS.
Tom Lane <tgl@sss.pgh.pa.us>
Fix representation of SORT_TYPE_STILL_IN_PROGRESS. It turns out that the code did indeed rely on a zeroed TuplesortInstrumentation.sortMethod field to indicate "this worker never did anything", although it seems the issue only comes up during certain race-condition-y cases. Hence, rearrange the TuplesortMethod enum to restore SORT_TYPE_STILL_IN_PROGRESS to having the value zero, and add some comments reinforcing that that isn't optional. Also future-proof a loop over the possible values of the enum. sizeof(bits32) happened to be the correct limit value, but only by purest coincidence. Per buildfarm and local investigation. Discussion: https://postgr.es/m/12222.1586223974@sss.pgh.pa.us
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/explain.c | modified | +5 −5 |
| src/include/utils/tuplesort.h | modified | +13 −7 |
Discussion
- [PATCH] Incremental sort (was: PoC: Partial sort) 359 messages · 2017-02-18 → 2020-07-14