Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for 2.12.x #6159

Merged
merged 7 commits into from
Oct 6, 2023
Merged

Fixes for 2.12.x #6159

merged 7 commits into from
Oct 6, 2023

Conversation

konskov
Copy link
Contributor

@konskov konskov commented Oct 6, 2023

Disable-check: force-changelog-file

jnidzwetzki and others added 7 commits October 6, 2023 13:37
The current version of the BGW scheduler mock does not support multiple
background workers. If a second worker was registered, the reference to
the previously registered worker gets lost. So, the implementation of
the mock scheduler only waits for the latest registered worker before
updating the mocked current time, which causes a race condition. If the
previous workers are still active and logging messages after this point,
the messages are logged with the updated mocked time. This leads to a
non-deterministic behavior and test failures. For example:

  msg_no | mock_time |    application_name     |    msg
---------+-----------+-------------------------+----------------------
-      1 |         0 | Retention Policy [1002] | job 1002 [...]
[...]
+      1 |   1000000 | Retention Policy [1002] | job 1002 [...]

(cherry picked from commit abf79f4)
The regression test bgw_db_scheduler tests if the BGW scheduler starts a
background job after it is created. However, this only happens if the
previous instance of the BGW scheduler is no longer active. If the old
BGW scheduler instance is still running, it will pick up the job and
prevent it from starting in the current test.

(cherry picked from commit ebaee6c)
This patch stops the background worker in the bgw_launcher test teardown
before the database is dropped. The current version of the test is flaky
because sometimes the database cannot be dropped due to BGW activity.

(cherry picked from commit 14e275a)
One of the test cases changes chunk status in order to fail
the background job in order to ensure jobs continue to be
scheduled even after such a scenario. The problem lies in
the race condition between compression policy and the status
update which both update the catalog and that causes random
test failures. The solution is to add the compression policy
after updating the status, eliminating the possibility of
race condition.

(cherry picked from commit 5cdd414)
The bgw_launcher test changes the tablespace for a database. However,
this requires that the database is used and no BGW are accessing the
database. This PR ensures that the background workers are stopped before
the tablespace is changed.

(cherry picked from commit d9e4a71)
Isolation test `cagg_insert` is flaky because refresh steps can
complete in any order. Adding constraints so that completion is
reported in the same order in all test runs.

Fixes timescale#5331

(cherry picked from commit 6bef59a)
When dropping a table, we get notices if that causes to cancel
background jobs and thus fail tests. By stopping the workers
before dropping the table, we should reduce this flakiness.

(cherry picked from commit 6e4d174)
@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

❗ No coverage uploaded for pull request base (2.12.x@563f2d5). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             2.12.x    #6159   +/-   ##
=========================================
  Coverage          ?   81.53%           
=========================================
  Files             ?      246           
  Lines             ?    56771           
  Branches          ?    12576           
=========================================
  Hits              ?    46288           
  Misses            ?     8081           
  Partials          ?     2402           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@konskov konskov marked this pull request as ready for review October 6, 2023 11:13
@github-actions github-actions bot requested review from mahipv and svenklemm October 6, 2023 11:13
@timescale timescale deleted a comment from github-actions bot Oct 6, 2023
@konskov konskov removed request for svenklemm and mahipv October 6, 2023 11:13
@konskov konskov merged commit 2f11814 into timescale:2.12.x Oct 6, 2023
38 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants