-
Notifications
You must be signed in to change notification settings - Fork 43
Spoc 384 (second part) #298
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
Open
danolivo
wants to merge
5
commits into
main
Choose a base branch
from
spoc-384-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+89
−51
Conversation
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
Member
|
@danolivo Please rebase and also try to take care of the Codacy complaint (check if sizeof(sap) >= sizeof(SpockApplyProgress)? as an assertion?) |
Shape the spock_group module a little: * Remove unused lookup function. * Make spock_group_foreach static, forasmuch as no one uses it outside the module. * Add forgotten ‘extern’ declarations.
There are plenty of places where Spock touches shared memory structures that may cause races. It is always an issue, even considering these structures are rarely accessed for writing. But the progress state is a high-frequency updated structure, and guarding it with a lock is critical.
After moving to HTAB implementation, we actually don't have a target connection. So, remove it. While here, fix forgotten 'extern' declaration in the 'spock_group.h' module.
In Spock 5, we used to employ a progress table and a transactional snapshot to ensure that the progress corresponds to the replication slot (snapshot, LSN), and we could request this state at any time until the transaction ends. With an HTAB, it's no longer true, and we need to invent extra hacks. With this commit, we take the progress state right before LR slot creation, which is as close as possible to the real state. It is still not entirely consistent in the case of Z0DAN, but while we use it just for information, it is ok. XXX: The code related to table syncing stays as is. Right now, we aren't sure if the progress state needs to be corrected if we re-sync a single table from the database. So, just keep the code untouched.
rasifr
reviewed
Jan 9, 2026
rasifr
approved these changes
Jan 9, 2026
Use direct structure assignment instead of memcpy for copying SpockApplyProgress. This is more idiomatic, type-safe, and resolves static analyzer warnings about buffer size validation. The compiler generates identical code while providing compile-time type checking and better code clarity.
Contributor
Author
Done |
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.
No description provided.