Commit 5638b9f
Add routine to get running worker pid (#295)
* Add extension_base.get_worker_pid() to look up a worker's PID by job ID
Exposes GetBaseWorkerPid() as an exportable C function (declared in
base_workers.h) that reads the shared-memory BaseWorkerHash under a
shared lock and returns the PID for the given worker ID in the current
database, or 0 if not found. The SQL wrapper get_worker_pid(int)
delegates to it. Tests cover both the running and not-found cases.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: David Christensen <david.christensen@snowflake.com>
* Remove get_worker_pid() from base SQL; keep only in upgrade path
The function is new in 3.3 so it belongs only in the 3.2->3.3 upgrade
script, not in the 1.6 base install SQL.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: David Christensen <david.christensen@snowflake.com>
* black format test_base_worker_launcher.py
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: David Christensen <david.christensen@snowflake.com>
---------
Signed-off-by: David Christensen <david.christensen@snowflake.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e7ae547 commit 5638b9f
File tree
4 files changed
+86
-0
lines changed- pg_extension_base
- include/pg_extension_base
- src
- tests/pytests
4 files changed
+86
-0
lines changedLines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
118 | 120 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
370 | 371 | | |
371 | 372 | | |
372 | 373 | | |
| |||
2925 | 2926 | | |
2926 | 2927 | | |
2927 | 2928 | | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
2928 | 2965 | | |
2929 | 2966 | | |
2930 | 2967 | | |
| |||
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
434 | 469 | | |
435 | 470 | | |
436 | 471 | | |
| |||
0 commit comments