Invalidate context state during cleanup #547
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.
Currently, when switching between modes, the follow process cleans up context files, which include details like WAL segment size and timeline. However, we haven't been resetting the in-memory state that decides whether the context should be read from these files. This can lead to the usage of outdated timeline information while retriving the context[1][2][3].
This commit addresses this issue by resetting the in-memory state during context cleanup. This ensures that the system will re-read the context from the files after any cleanup, leading to more accurate and reliable timeline information.
[1]
pgcopydb/src/bin/pgcopydb/ld_transform.c
Lines 201 to 212 in 8d305a5
[2]
pgcopydb/src/bin/pgcopydb/follow.c
Lines 428 to 438 in 8d305a5
[3]
pgcopydb/src/bin/pgcopydb/ld_apply.c
Lines 206 to 216 in 8d305a5