[PR #2] [MERGED] Label output with Aufgabe + strategy + index config, fix lock hangs #1

Closed
opened 2026-09-04 00:22:24 +02:00 by Stone_Red · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/sandronator/finetuning_aufgabe4/pull/2
Author: @sandronator
Created: 5/26/2026
Status: Merged
Merged: 5/26/2026
Merged by: @sandronator

Base: mainHead: claude/quizzical-haibt-fd6d93


📝 Commits (2)

  • da2453d Label output with Aufgabe + strategy + index config, fix lock hangs
  • e7f2d0d Merge branch 'main' into claude/quizzical-haibt-fd6d93

📊 Changes

6 files changed (+52 additions, -51 deletions)

View changed files

📝 baseStrategy.py (+22 -17)
📝 hashJoinStrategy.py (+2 -2)
📝 main.py (+13 -19)
📝 manager.py (+11 -9)
📝 nestedInnerLoopStrategy.py (+2 -2)
📝 sortMergeStrategy.py (+2 -2)

📄 Description

Two related improvements to make the test runs both usable and diagnosable:

  1. Avoid lock waits / "deadlock" hangs during CLUSTER The Manager connection ran EXPLAIN ANALYZE without committing, so psycopg2's default autocommit=False left an open transaction holding AccessShareLock on publ and auth. The next setup_db then blocked on DROP INDEX / CLUSTER (both need AccessExclusiveLock), visible as a hang -- typically at the CLUSTER step. Setting conn_postsql.autocommit = True releases the locks immediately after each SELECT, which is safe here because all Manager queries are read-only.

  2. Make the run output identify which test is running The "Running: ..." line previously printed only the query key (query_1/query_2), shadowing 'strategy' with the dict key and never surfacing which join strategy or index config was active. Output now reads e.g. "[Aufgabe 3b | SortMergeStrategy | idx=nc-both]" by:

    • using self.class.name so subclasses surface correctly
    • passing the current index_config from Manager into the strategy
    • threading an optional 'aufgabe' label through Manager.execute() and into each strategy's run() (including the Nested/SortMerge/ Hash wrappers that override run()).

main.py now tags each execute() call with its assignment number.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/sandronator/finetuning_aufgabe4/pull/2 **Author:** [@sandronator](https://github.com/sandronator) **Created:** 5/26/2026 **Status:** ✅ Merged **Merged:** 5/26/2026 **Merged by:** [@sandronator](https://github.com/sandronator) **Base:** `main` ← **Head:** `claude/quizzical-haibt-fd6d93` --- ### 📝 Commits (2) - [`da2453d`](https://github.com/sandronator/finetuning_aufgabe4/commit/da2453da32c49e2996fbd7bf7b81c1ac0573a3c6) Label output with Aufgabe + strategy + index config, fix lock hangs - [`e7f2d0d`](https://github.com/sandronator/finetuning_aufgabe4/commit/e7f2d0d66cdd7f24b0b9c186d46e5b0f42db6721) Merge branch 'main' into claude/quizzical-haibt-fd6d93 ### 📊 Changes **6 files changed** (+52 additions, -51 deletions) <details> <summary>View changed files</summary> 📝 `baseStrategy.py` (+22 -17) 📝 `hashJoinStrategy.py` (+2 -2) 📝 `main.py` (+13 -19) 📝 `manager.py` (+11 -9) 📝 `nestedInnerLoopStrategy.py` (+2 -2) 📝 `sortMergeStrategy.py` (+2 -2) </details> ### 📄 Description Two related improvements to make the test runs both usable and diagnosable: 1. Avoid lock waits / "deadlock" hangs during CLUSTER The Manager connection ran EXPLAIN ANALYZE without committing, so psycopg2's default autocommit=False left an open transaction holding AccessShareLock on publ and auth. The next setup_db then blocked on DROP INDEX / CLUSTER (both need AccessExclusiveLock), visible as a hang -- typically at the CLUSTER step. Setting conn_postsql.autocommit = True releases the locks immediately after each SELECT, which is safe here because all Manager queries are read-only. 2. Make the run output identify which test is running The "Running: ..." line previously printed only the query key (query_1/query_2), shadowing 'strategy' with the dict key and never surfacing which join strategy or index config was active. Output now reads e.g. "[Aufgabe 3b | SortMergeStrategy | idx=nc-both]" by: - using self.__class__.__name__ so subclasses surface correctly - passing the current index_config from Manager into the strategy - threading an optional 'aufgabe' label through Manager.execute() and into each strategy's run() (including the Nested/SortMerge/ Hash wrappers that override run()). main.py now tags each execute() call with its assignment number. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Stone_Red added the pull-request label 2026-09-04 00:22:24 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sandronator/finetuning_aufgabe4#1