-
Notifications
You must be signed in to change notification settings - Fork 69
Adapt pg_pathman for PG 11. #166
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
Conversation
fc73125
to
bbf5a65
Compare
Codecov Report
@@ Coverage Diff @@ ## next #166 +/- ## ========================================== - Coverage 90.07% 90.04% -0.03% ========================================== Files 40 40 Lines 6460 6462 +2 ========================================== Hits 5819 5819 - Misses 641 643 +2
Continue to review full report at Codecov.
|
src/compat/pg_compat.c
Outdated
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.
Could you extract this one as compute_parallel_worker
macro, please?
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.
done
src/hooks.c
Outdated
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.
And also this one.
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.
done
src/init.c
Outdated
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.
Bikeshedding: usually, I place conditional includes at the bottom.
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.
done
src/hooks.c
Outdated
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.
Are you sure this is ok? We might add new AppendRelInfos
each time pathman_rel_pathlist_hook
is called.
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.
Yeah, this is not good. Fixed.
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?
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.
Because since 9fa6f00b1308dd10da4eca2f31ccbfc7b35bb461 AllocSetContextCreate
ensures that this arg is __builtin_constant_p
, and __FUNCTION__
stores func name in global buffer.
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.
Ok, thanks!
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.
This one looks odd.
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.
See below changes in pg_compat.h
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.
Nvm.
src/nodes_common.c
Outdated
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.
NOTE: this is closely related to setup_append_rel_array
.
UPD: maybe we should reconsider each usage of root->append_rel_list
.
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.
Well, except for access in nodes_common.c all others are just iterations over the whole list, so not sure we need to change something here.
src/pathman_workers.c
Outdated
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.
Nice catch, but this is also wrong. SPI requires nulls to be equal to 'n'
. I guess we should get rid of nulls
array and just pass NULL
instead.
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.
Indeed, fixed.
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.
Nice one.
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.
I guess ERR_PART_ATTR_MULTIPLE_RESULTS
is useless now, right?
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.
Yes. As commit message says, inclusion of partition_filter.h created dependency hell here.
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.
Shouldn't we raise a notice in case of insufficient_privilege
? Otherwise we won't know if this call failed.
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.
Well, if it is indeed insufficient_privilige
, then that's what we are after here, so silently eating it is fine. Actually, an attempt to hide the error is the only reason for this change -- one word changed in the error message from relation
to table
in 10 and 11 PG. If this is any other exception, it will fall through shouting along the way.
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.
(We still can add some unifying NOTICE in exception handler or just a comment explaining this, if you like)
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.
Fixed
src/relation_info.c
Outdated
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.
Probably should replace 11000
with 110000
.
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.
Fixed
a7e7a62
to
26e9f96
Compare
I kinda lost interest to exorcise a couple of tests further in attempts to make them pass on all supported versions and just added copies. These are * pathman_expressions now differs because planner converts ROW(Const, Const) to just Const of record type. * Same with pathman_rebuild_updates. I have removed inclusion of partition_filter.h in pg_compat.h in 9.5 as it created circular dependency hell. I think it is not worthwhile to fight with it since the only thing actually needed was error message, which is used in this single place. Small typo fix in partitioning_test.py: con2.begin instead of con1.begin. Finally, run python tests with --failfast and --verbose options.
Also a bunch of other stuff noted by @funbringer.
442d54c
to
50bfb92
Compare
Merged, thanks a lot!
I kinda lost interest to exorcise a couple of tests further in attempts to make
them pass on all supported versions and just added copies. These are
just Const of record type.
I have removed inclusion of partition_filter.h in pg_compat.h in 9.5 as it
created circular dependency hell. I think it is not worthwhile to fight with it
since the only thing actually needed was error message, which is used in this
single place.
Small typo fix in partitioning_test.py: con2.begin instead of con1.begin.
Finally, run python tests with --failfast and --verbose options.