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

Enabling distributed compression within a procedure doesn't actually enable compression. #3705

Closed
phemmer opened this issue Oct 15, 2021 · 2 comments · Fixed by #3706
Closed
Assignees
Labels

Comments

@phemmer
Copy link

phemmer commented Oct 15, 2021

Relevant system information:

  • OS: Debian 10/Buster
  • PostgreSQL version (output of postgres --version): postgres (PostgreSQL) 13.4 (Debian 13.4-1.pgdg100+1)
  • TimescaleDB version (output of \dx in psql): 2.4.1
  • Installation method: apt

Describe the bug
Enabling compression on a distributed hypertable from within a procedure doesn't actually enable compression.

To Reproduce
Steps to reproduce the behavior:

create table test (time timestamp, v int);
select create_distributed_hypertable('test','time');
create procedure test_set_compression() language plpgsql as $$
    begin
        alter table test set (timescaledb.compress);
    end;
$$;
call test_set_compression();
insert into test values (now(), 0);
select compress_chunk(show_chunks) from show_chunks('test');

Expected behavior
success

Actual behavior

ERROR:  [datanode1]: compression not enabled on "test"
DETAIL:  It is not possible to compress chunks on a hypertable that does not have compression enabled.
HINT:  Enable compression using ALTER TABLE with the timescaledb.compress option.

Additional context

# select compression_enabled from timescaledb_information.hypertables where hypertable_name='test';
 compression_enabled 
---------------------
 t
(1 row)

Seems like this might be related to #3663 which was fixed in #3673. However I'm not sure if that fix was restricted to just drop statements, or if it would cover this case as well.

@phemmer phemmer changed the title Enabling distributed compression within a procedure does actually enable compression. Enabling distributed compression within a procedure doesn't actually enable compression. Oct 15, 2021
@pmwkaa pmwkaa self-assigned this Oct 15, 2021
pmwkaa added a commit to pmwkaa/timescaledb that referenced this issue Oct 16, 2021
Make sure `ALTER TABLE SET (timescaledb.compress)` command properly
propagated to the data nodes when executed within a procedure.

This includes only test a case, actual fix was done in timescale#3663.

Fix timescale#3705
@pmwkaa
Copy link
Contributor

pmwkaa commented Oct 16, 2021

@phemmer I can confirm that it works after #3673 been merged. I've also made a PR (#3706) that includes your test case, just in case.

pmwkaa added a commit to pmwkaa/timescaledb that referenced this issue Oct 16, 2021
Make sure `ALTER TABLE SET (timescaledb.compress)` command properly
propagated to the data nodes when executed within a procedure.

This includes only test a case, actual fix was done in timescale#3663.

Fix timescale#3705
@akuzm akuzm added the bug label Oct 28, 2021
@svenklemm
Copy link
Member

Fixed in 2.5.0

pmwkaa added a commit to pmwkaa/timescaledb that referenced this issue Nov 22, 2021
Make sure ALTER TABLE SET (timescaledb.compress) command properly
propagated to the data nodes when executed within a procedure.

This includes only test a case, actual fix was done in timescale#3663.

Fix timescale#3705
pmwkaa added a commit to pmwkaa/timescaledb that referenced this issue Nov 22, 2021
Make sure ALTER TABLE SET (timescaledb.compress) command properly
propagated to the data nodes when executed within a procedure.

This includes only test a case, actual fix was done in timescale#3663.

Fix timescale#3705
pmwkaa added a commit to pmwkaa/timescaledb that referenced this issue Nov 22, 2021
Make sure ALTER TABLE SET (timescaledb.compress) command properly
propagated to the data nodes when executed within a procedure.

This includes only test a case, actual fix was done in timescale#3663.

Fix timescale#3705
pmwkaa added a commit to pmwkaa/timescaledb that referenced this issue Nov 22, 2021
Make sure ALTER TABLE SET (timescaledb.compress) command properly
propagated to the data nodes when executed within a procedure.

This includes only test a case, actual fix was done in timescale#3663.

Fix timescale#3705
pmwkaa added a commit that referenced this issue Nov 22, 2021
Make sure ALTER TABLE SET (timescaledb.compress) command properly
propagated to the data nodes when executed within a procedure.

This includes only test a case, actual fix was done in #3663.

Fix #3705
duncan-tsdb pushed a commit that referenced this issue Dec 2, 2021
Make sure ALTER TABLE SET (timescaledb.compress) command properly
propagated to the data nodes when executed within a procedure.

This includes only test a case, actual fix was done in #3663.

Fix #3705
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants