Fix errors and add isolation tests for OSM API #6154
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit fixes two issues with the osm range update API:
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.
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