Skip to content
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

Propagate privileges from hypertables to chunks #2255

Merged
merged 1 commit into from
Aug 26, 2020

Conversation

mkindahl
Copy link
Contributor

Whenever chunks are created, no privileges are added to the chunks.
For accesses that go through the hypertable permission checks are
ignored so reads and writes will succeed anyway. However, for direct
accesses to the chunks, permission checks are done, which creates
problems for, e.g., pg_dump.

This commit fixes this by propagating GRANT and REVOKE statements
to the chunks when executed on the hypertable, and whenever new chunks
are created, privileges are copied from the hypertable.

This commit is specific for the 1.7 branch. The fix for 2.0 is
different.

Fixes #1927

@mkindahl mkindahl added this to the 1.7.3 milestone Aug 25, 2020
@mkindahl mkindahl requested a review from a team as a code owner August 25, 2020 06:43
@mkindahl mkindahl self-assigned this Aug 25, 2020
@mkindahl mkindahl requested review from pmwkaa and removed request for a team August 25, 2020 06:43
Copy link
Member

@svenklemm svenklemm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to cause a lot of segfaults when running the postgres regression test suite

@mkindahl
Copy link
Contributor Author

This seems to cause a lot of segfaults when running the postgres regression test suite

Yes, noted that. Can't reproduce it locally though.

@mkindahl mkindahl force-pushed the fix_grants branch 3 times, most recently from 1acd0bd to b66f6a9 Compare August 25, 2020 10:05
Whenever chunks are created, no privileges are added to the chunks.
For accesses that go through the hypertable permission checks are
ignored so reads and writes will succeed anyway. However, for direct
accesses to the chunks, permission checks are done, which creates
problems for, e.g., `pg_dump`.

This commit fixes this by propagating `GRANT` and `REVOKE` statements
to the chunks when executed on the hypertable, and whenever new chunks
are created, privileges are copied from the hypertable.

This commit is specific for the 1.7 branch. The fix for 2.0 is
different.

Fixes timescale#1927
@mkindahl mkindahl merged commit b5df0e5 into timescale:1.7.x Aug 26, 2020
@mkindahl mkindahl deleted the fix_grants branch August 26, 2020 07:22
@mkindahl mkindahl mentioned this pull request Aug 26, 2020
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Aug 26, 2020
This maintenance release contains bugfixes since the 1.7.2 release. We deem it high
priority for upgrading.

In particular the fixes contained in this maintenance release address bugs in compression,
drop_chunks and the background worker scheduler.

**Bugfixes**
* timescale#2059 Improve infering start and stop arguments from gapfill query
* timescale#2067 Support moving compressed chunks
* timescale#2068 Apply SET TABLESPACE for compressed chunks
* timescale#2090 Fix index creation with IF NOT EXISTS for existing indexes
* timescale#2092 Fix delete on tables involving hypertables with compression
* timescale#2164 Fix telemetry installed_time format
* timescale#2184 Fix background worker scheduler memory consumption
* timescale#2222 Fix `negative bitmapset member not allowed` in decompression
* timescale#2255 Propagate privileges from hypertables to chunks
* timescale#2256 Fix segfault in chunk_append with space partitioning
* timescale#2259 Fix recursion in cache processing
* timescale#2261 Lock dimension slice tuple when scanning

**Thanks**
* @akamensky for reporting an issue with drop_chunks and ChunkAppend with space partitioning
* @dewetburger430 for reporting an issue with setting tablespace for compressed chunks
* @fvannee for reporting an issue with cache invalidation
* @nexces for reporting an issue with ChunkAppend on space-partitioned hypertables
* @PichetGoulu for reporting an issue with index creation and IF NOT EXISTS
* @sezaru for reporting an issue with background worker scheduler memory consumption
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Aug 27, 2020
This maintenance release contains bugfixes since the 1.7.2 release. We deem it high
priority for upgrading.

In particular the fixes contained in this maintenance release address bugs in compression,
drop_chunks and the background worker scheduler.

**Bugfixes**
* timescale#2059 Improve infering start and stop arguments from gapfill query
* timescale#2067 Support moving compressed chunks
* timescale#2068 Apply SET TABLESPACE for compressed chunks
* timescale#2090 Fix index creation with IF NOT EXISTS for existing indexes
* timescale#2092 Fix delete on tables involving hypertables with compression
* timescale#2164 Fix telemetry installed_time format
* timescale#2184 Fix background worker scheduler memory consumption
* timescale#2222 Fix `negative bitmapset member not allowed` in decompression
* timescale#2255 Propagate privileges from hypertables to chunks
* timescale#2256 Fix segfault in chunk_append with space partitioning
* timescale#2259 Fix recursion in cache processing
* timescale#2261 Lock dimension slice tuple when scanning

**Thanks**
* @akamensky for reporting an issue with drop_chunks and ChunkAppend with space partitioning
* @dewetburger430 for reporting an issue with setting tablespace for compressed chunks
* @fvannee for reporting an issue with cache invalidation
* @nexces for reporting an issue with ChunkAppend on space-partitioned hypertables
* @PichetGoulu for reporting an issue with index creation and IF NOT EXISTS
* @sezaru for reporting an issue with background worker scheduler memory consumption
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Aug 27, 2020
This maintenance release contains bugfixes since the 1.7.2 release. We deem it high
priority for upgrading.

In particular the fixes contained in this maintenance release address issues in compression,
drop_chunks and the background worker scheduler.

**Bugfixes**
* timescale#2059 Improve infering start and stop arguments from gapfill query
* timescale#2067 Support moving compressed chunks
* timescale#2068 Apply SET TABLESPACE for compressed chunks
* timescale#2090 Fix index creation with IF NOT EXISTS for existing indexes
* timescale#2092 Fix delete on tables involving hypertables with compression
* timescale#2164 Fix telemetry installed_time format
* timescale#2184 Fix background worker scheduler memory consumption
* timescale#2222 Fix `negative bitmapset member not allowed` in decompression
* timescale#2255 Propagate privileges from hypertables to chunks
* timescale#2256 Fix segfault in chunk_append with space partitioning
* timescale#2259 Fix recursion in cache processing
* timescale#2261 Lock dimension slice tuple when scanning

**Thanks**
* @akamensky for reporting an issue with drop_chunks and ChunkAppend with space partitioning
* @dewetburger430 for reporting an issue with setting tablespace for compressed chunks
* @fvannee for reporting an issue with cache invalidation
* @nexces for reporting an issue with ChunkAppend on space-partitioned hypertables
* @PichetGoulu for reporting an issue with index creation and IF NOT EXISTS
* @prathamesh-sonpatki for contributing a typo fix
* @sezaru for reporting an issue with background worker scheduler memory consumption
svenklemm added a commit that referenced this pull request Aug 27, 2020
This maintenance release contains bugfixes since the 1.7.2 release. We deem it high
priority for upgrading.

In particular the fixes contained in this maintenance release address issues in compression,
drop_chunks and the background worker scheduler.

**Bugfixes**
* #2059 Improve infering start and stop arguments from gapfill query
* #2067 Support moving compressed chunks
* #2068 Apply SET TABLESPACE for compressed chunks
* #2090 Fix index creation with IF NOT EXISTS for existing indexes
* #2092 Fix delete on tables involving hypertables with compression
* #2164 Fix telemetry installed_time format
* #2184 Fix background worker scheduler memory consumption
* #2222 Fix `negative bitmapset member not allowed` in decompression
* #2255 Propagate privileges from hypertables to chunks
* #2256 Fix segfault in chunk_append with space partitioning
* #2259 Fix recursion in cache processing
* #2261 Lock dimension slice tuple when scanning

**Thanks**
* @akamensky for reporting an issue with drop_chunks and ChunkAppend with space partitioning
* @dewetburger430 for reporting an issue with setting tablespace for compressed chunks
* @fvannee for reporting an issue with cache invalidation
* @nexces for reporting an issue with ChunkAppend on space-partitioned hypertables
* @PichetGoulu for reporting an issue with index creation and IF NOT EXISTS
* @prathamesh-sonpatki for contributing a typo fix
* @sezaru for reporting an issue with background worker scheduler memory consumption
svenklemm added a commit that referenced this pull request Aug 27, 2020
This maintenance release contains bugfixes since the 1.7.2 release. We deem it high
priority for upgrading.

In particular the fixes contained in this maintenance release address issues in compression,
drop_chunks and the background worker scheduler.

**Bugfixes**
* #2059 Improve infering start and stop arguments from gapfill query
* #2067 Support moving compressed chunks
* #2068 Apply SET TABLESPACE for compressed chunks
* #2090 Fix index creation with IF NOT EXISTS for existing indexes
* #2092 Fix delete on tables involving hypertables with compression
* #2164 Fix telemetry installed_time format
* #2184 Fix background worker scheduler memory consumption
* #2222 Fix `negative bitmapset member not allowed` in decompression
* #2255 Propagate privileges from hypertables to chunks
* #2256 Fix segfault in chunk_append with space partitioning
* #2259 Fix recursion in cache processing
* #2261 Lock dimension slice tuple when scanning

**Thanks**
* @akamensky for reporting an issue with drop_chunks and ChunkAppend with space partitioning
* @dewetburger430 for reporting an issue with setting tablespace for compressed chunks
* @fvannee for reporting an issue with cache invalidation
* @nexces for reporting an issue with ChunkAppend on space-partitioned hypertables
* @PichetGoulu for reporting an issue with index creation and IF NOT EXISTS
* @prathamesh-sonpatki for contributing a typo fix
* @sezaru for reporting an issue with background worker scheduler memory consumption
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants