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
Remove error for correct bootstrap of data node #2505
Remove error for correct bootstrap of data node #2505
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2505 +/- ##
==========================================
+ Coverage 90.04% 90.06% +0.02%
==========================================
Files 212 211 -1
Lines 34219 33729 -490
==========================================
- Hits 30813 30379 -434
+ Misses 3406 3350 -56
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good.
I am slightly concerned about the overall if_not_exists logic here, since it tries to be smart and recreate non-existing objects step by step even if the foreign server exists on the AN, which suggests that DN potentially could be in non-sync state with AN. Basically it combines create and recovery (or healing) logic in one function, which might be not obvious and error prone in some sense. I guess dropping DN and adding it again would not work here as well, since drop does not drop DN's database.
if (PQntuples(res) == 0) | ||
return false; | ||
|
||
Assert(PQnfields(res) > 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not 3? is it for future compatability?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this ensure that fields 0, 1, and 2 can be read, which are three elements.
The |
Wasn't using |
No, because bootstrap creates a schema and adds data to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
If the database exists on the data node when executing `add_data_node` it will generate an error in the data node log, which can cause problems since there is an error indication in the log but there are no failing operations. This commit fixes this by first validating the database and only if it does not exist, create the database. Closes timescale#2503
eb5cf46
to
6bf5429
Compare
If the database exists on the data node when executing
add_data_node
it will generate an error in the data node log, which can cause
problems since there is an error indication in the log but there are no
failing operations.
This commit fixes this by first validating the database and only if it
does not exist, create the database.
Closes #2503