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

Fix errors and add isolation tests for OSM API #6154

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

konskov
Copy link
Contributor

@konskov konskov commented Oct 5, 2023

This commit fixes two issues with the osm range update API:

  1. Deadlock between two concurrent range updates. Two transactions concurrently attempting to update the range of the OSM chunk by calling hypertable_osm_range_update would deadlock because the dimension slice tuple was first locked with a FOR KEY SHARE lock, then a FOR UPDATE lock was requested before proceeding with the dimension slice tuple udpate.
    This commit fixes the deadlock by taking FOR UPDATE lock on the tuple from the start, before proceeding to update it.

  2. Tuple concurrently updated error for hypertable tuple. When one session tries to update the range of the OSM chunk and another enables compression on the hypertable, the update failed with tuple concurrently updated error. This commit fixes this by first locking the hypertable tuple with a FOR UPDATE lock before proceeding to UPDATE it.

Isolation tests for OSM range API are also added.

(cherry picked from commit 7a5cecf)

Disable-check: force-changelog-file

This commit fixes two issues with the osm range update API:

1. Deadlock between two concurrent range updates.
Two transactions concurrently attempting to update the range
of the OSM chunk by calling hypertable_osm_range_update would
deadlock because the dimension slice tuple was first locked with
a FOR KEY SHARE lock, then a FOR UPDATE lock was requested before
proceeding with the dimension slice tuple udpate.
This commit fixes the deadlock by taking FOR UPDATE lock on the
tuple from the start, before proceeding to update it.

2. Tuple concurrently updated error for hypertable tuple.
When one session tries to update the range of the OSM chunk and another
enables compression on the hypertable, the update failed with tuple
concurrently updated error. This commit fixes this by first locking the
hypertable tuple with a FOR UPDATE lock before proceeding to UPDATE it.

Isolation tests for OSM range API are also added.

(cherry picked from commit 7a5cecf)
@github-actions github-actions bot requested review from erimatnor and mkindahl October 5, 2023 11:51
@timescale timescale deleted a comment from github-actions bot Oct 5, 2023
@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

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

@@            Coverage Diff            @@
##             2.12.x    #6154   +/-   ##
=========================================
  Coverage          ?   81.54%           
=========================================
  Files             ?      246           
  Lines             ?    56771           
  Branches          ?    12576           
=========================================
  Hits              ?    46293           
  Misses            ?     8076           
  Partials          ?     2402           

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

@konskov konskov merged commit 563f2d5 into timescale:2.12.x Oct 5, 2023
36 of 38 checks passed
@konskov konskov deleted the 2.12.x branch October 12, 2023 06:56
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.

1 participant