Repository navigation
docs(pycubrid): warn that a bare SELECT-then-update is not a safe ODKU fallback - #631
Open
IG-ABHINAV wants to merge 5 commits into
Open
IG-ABHINAV wants to merge 5 commits into
IG-ABHINAV wants to merge 5 commits into
Conversation
…U fallback Qualify the atomic-counter recipe's adaptation note and README so a non-atomic read-modify-write is not suggested as a drop-in replacement for ON DUPLICATE KEY UPDATE. Fixes cubrid-lab#626
yeongseon
approved these changes
Nov 22, 2026
yeongseon
left a comment
Contributor
There was a problem hiding this comment.
Reviewed HEAD 058b80f. The replacement docstring correctly warns that a bare SELECT-then-INSERT/UPDATE cannot replace the SQL-side atomic ODKU increment under concurrency, and README now states the same distinction. No executable behavior changes. Source approved; CI is action_required and #634 overlaps on the same recipe, so merge at most one final treatment and coordinate the competing PR.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What & why
Issue #626 points out that the header of
fundamentals/pycubrid/13_atomic_counters.pycorrectly teachesINSERT ... ON DUPLICATE KEY UPDATE hit_count = hit_count + ?as an atomic increment, but then suggests switching to a bare SELECT-then-INSERT/UPDATE if ODKU is unsupported. Without a transaction, locking, or compare-and-swap strategy, two writers can both read the same count and overwrite an increment, or race to insert the same key.Closes #626
How
13_atomic_counters.pyrow infundamentals/pycubrid/README.mdto say the same thing.Verification
The Makefile
check-docs/docs-checktargets were run as the equivalent Python commands (makeis not installed on this machine). Results:python3 -m doctest scripts/check_docs_reason.py -v— 6 passed.python3 -m unittest discover -s tests -p 'test_docs_reason.py' -v— 15 tests, OK.python3 -m doctest scripts/check_docs_sync.py -v— 25 passed.python3 -m unittest discover -s tests -p 'test_docs_sync.py' -v— 23 tests, OK.python3 scripts/check_docs_sync.py— exit 0,OK: every example directory is referenced in README.md and llms.txt.python3 scripts/check_support_matrix_counts.py— exit 0, counts match.python3 scripts/check_dependency_floors.py— exit 0, floors match.python3 -m unittest discover -s tests -p 'test_translation_sync.py' -v— 17 tests, OK.python3 -m doctest scripts/stage_docs.py -v— 6 passed.python3 -m unittest discover -s tests -p 'test_stage_docs.py' -v— 21 tests, OK.python3 -m unittest discover -s tests -p 'test_lint_changelog.py' -v— 24 tests, OK.python3 scripts/lint_changelog.py— exit 0,OK: no release sections yet; tags v0.1.0, v0.2.0 predate CHANGELOG.md and have none.markdown-it-py==4.2.0andpytest==9.2.0from.github/requirements-docs-check.txt:python -m pytest tests/test_check_docs_links.py -q—201 passed, 4 skipped in 1.01spython scripts/check_docs_links.py— exit 0,OK: 83 Markdown files; local links, anchors, fences and commands resolveCommit: 058b80f — author:IG-ABHINAV IG-ABHINAV@users.noreply.github.com committer:IG-ABHINAV IG-ABHINAV@users.noreply.github.com
Judgment calls
High level description of this Pull-request
See What & why / How above.
Example Details
Validation
ruffwas not on PATH at first; live CUBRID andmake verifywere not run because executable SQL and goldens were not changed.Review and Final Disposition
Related PRs and Execution Preconditions
Related PRs and precedence: None
Unresolved decision or dependency: None
Related Issues
Closes #626
CHECKLIST:
cookbook_(unchanged)ruff checkandruff format --check— will note in a follow-up comment if needed; only a docstring was edited