fabriziomello

fabriziomello

PostgreSQL Developer at @TimescaleDB

Member Since 10 years ago

PostgreSQL Developer, Bagé

Experience Points
97
follower
Lessons Completed
29
follow
Lessons Completed
35
stars
Best Reply Awards
81
repos

188 contributions in the last year

Pinned
⚡ PostgreSQL extension to normalize SQL statements
⚡ Repositório com exemplos práticos de Database Refactorings
⚡ Manage your pg_hba.conf file using SQL
⚡ PostgreSQL extension that implements non-Standard Time-based K-sorted, Lexicographically Unique Identifiers
⚡ Exemplo de código para Dojo escrito em PL/pgSQL (PostgreSQL)
⚡ Initialize a new logical subscriber from a physical base backup
Activity
Nov
26
2 days ago
Activity icon
created branch
createdAt 1 day ago
push

fabriziomello push fabriziomello/timescaledb

fabriziomello
fabriziomello

Add deparser for CreateTrigStmt

Add deparser for CreateTrigStmt to use for distributed hypertables.

Fixes #3825

commit sha: 58ad8bab663f24ec0780e4f91bb9949711b07bec

push time in 2 days ago
open pull request

fabriziomello wants to merge timescale/timescaledb

fabriziomello
fabriziomello

Monthly buckets support in CAGGs

Monthly buckets support in CAGGs

This patch allows using time_bucket_ng("N month", ...) in CAGGs. Users can also
specify years, or months AND years. CAGGs on top of distributed hypertables
are supported as well.
fabriziomello
fabriziomello

@afiskon I agree It's an old style (dated from 1996) Postgres stuff used in few places:

main on  main [$?] 
➜ git grep AttrNumberGetAttrOffset
src/backend/catalog/index.c:                                 AttrNumberGetAttrOffset(atnum));
src/backend/replication/logical/relation.c:         attnum = AttrNumberGetAttrOffset(attnum);
src/include/access/attnum.h: * AttrNumberGetAttrOffset
src/include/access/attnum.h:#define AttrNumberGetAttrOffset(attNum) \

But I just suggested because it is used in a lot of places in our codebase:

timescaledb on  master [$!] 
➜ git grep AttrNumberGetAttrOffset | wc -l
414
pull request

fabriziomello merge to timescale/timescaledb

fabriziomello
fabriziomello

Monthly buckets support in CAGGs

Monthly buckets support in CAGGs

This patch allows using time_bucket_ng("N month", ...) in CAGGs. Users can also
specify years, or months AND years. CAGGs on top of distributed hypertables
are supported as well.
Nov
25
3 days ago
pull request

fabriziomello merge to timescale/timescaledb

fabriziomello
fabriziomello

Add deparser for CreateTrigStmt

Add deparser for CreateTrigStmt to use for distributed hypertables.

Fixes #3825

push

fabriziomello push fabriziomello/timescaledb

fabriziomello
fabriziomello

Properly handle max_retries option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

commit sha: da8ce2e140cb056b7a7bfbc5b84e5b19771a1180

push time in 3 days ago
Activity icon
delete
deleted time in 3 days ago
push

fabriziomello push timescale/timescaledb

fabriziomello
fabriziomello

Properly handle max_retries option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

commit sha: da8ce2e140cb056b7a7bfbc5b84e5b19771a1180

push time in 3 days ago
pull request

fabriziomello pull request timescale/timescaledb

fabriziomello
fabriziomello

Properly handle `max_retries` option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

Activity icon
issue

fabriziomello issue timescale/timescaledb

fabriziomello
fabriziomello

Failing Jobs Run Forever, Ignoring max_retries

Relevant system information:

  • TimescaleDB version (output of \dx in psql): 2.1.0

Describe the bug While the documentation describes being able to set a max_retries value for a background worker, the scheduler code on failure doesn't seem to actually handle this value, resulting in failed jobs running forever. It does use the retry_interval to reschedule, but it does not ever halt job execution after any number of consecutive failures.

To Reproduce

--create working procedure
CREATE OR REPLACE PROCEDURE failure(job_id int, config jsonb) LANGUAGE PLPGSQL AS
$$
BEGIN
  RAISE NOTICE 'Executing action % with config %', job_id, config;
END
$$;


--add it as a job
SELECT add_job('failure','1h');


--alter its schedule so it runs once a second, with a max_retry of 4, and start it now. Alter job id as necessary
SELECT alter_job(1000, max_retries => 4, schedule_interval => interval '1 second', next_start => now());

--see it running
select * from timescaledb_information.job_stats;

--break the function - this has an unhandled select, which errors out when the procedure is called.
CREATE OR REPLACE PROCEDURE failure(job_id int, config jsonb) LANGUAGE PLPGSQL AS
$$
BEGIN
  RAISE NOTICE 'Executing action % with config %', job_id, config;
  select * from test;
END
$$;

--see it is now failing, and keeps running forever
select * from timescaledb_information.job_stats;

Expected behavior I would expect that this job would be disabled after reaching max_retries

Actual behavior The job runs forever.

Nov
24
4 days ago
open pull request

fabriziomello wants to merge timescale/timescaledb

fabriziomello
fabriziomello

Properly handle `max_retries` option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

pull request

fabriziomello merge to timescale/timescaledb

fabriziomello
fabriziomello

Properly handle `max_retries` option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

push

fabriziomello push fabriziomello/timescaledb

fabriziomello
fabriziomello

Properly handle max_retries option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

commit sha: 288138cbf1746975c46d45cd23ee9d12a070f675

push time in 3 days ago
open pull request

fabriziomello wants to merge timescale/timescaledb

fabriziomello
fabriziomello

Properly handle `max_retries` option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

fabriziomello
fabriziomello

I changed it to include more details per @svenklemm suggestion

pull request

fabriziomello merge to timescale/timescaledb

fabriziomello
fabriziomello

Properly handle `max_retries` option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

open pull request

fabriziomello wants to merge timescale/timescaledb

fabriziomello
fabriziomello

Properly handle `max_retries` option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

fabriziomello
fabriziomello
pull request

fabriziomello merge to timescale/timescaledb

fabriziomello
fabriziomello

Properly handle `max_retries` option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

open pull request

fabriziomello wants to merge timescale/timescaledb

fabriziomello
fabriziomello

Properly handle `max_retries` option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

fabriziomello
fabriziomello

I moved because the job_api.c module include the job.h and to do what you proposed I should include job_api.h into job.c, so to me it seems weird (cyclic dependency).

pull request

fabriziomello merge to timescale/timescaledb

fabriziomello
fabriziomello

Properly handle `max_retries` option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

open pull request

fabriziomello wants to merge timescale/timescaledb

fabriziomello
fabriziomello

Properly handle `max_retries` option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

fabriziomello
fabriziomello

I did not make any changes, just moved the code around

pull request

fabriziomello merge to timescale/timescaledb

fabriziomello
fabriziomello

Properly handle `max_retries` option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

pull request

fabriziomello merge to timescale/timescaledb

fabriziomello
fabriziomello

Eliminate deadlock for recompress_chunk

When executing recompress_chunk and a query at the same time, a deadlock can be generated because the chunk relation and the chunk index are locked in different orders. In particular, when recompress_chunk is executing, it will first decompress the chunk and as part of that lock the uncompressed chunk index in AccessExclusive mode and when trying to compress the chunk again it will try to lock the uncompressed chunk in AccessExclusive as part of truncating it.

To avoid the deadlock, this commit skips rebuilding the uncompressed chunk index when decompressing the chunk since it will not change when incorporating new rows into the compressed chunk.

Fixes #3846

push

fabriziomello push fabriziomello/timescaledb

fabriziomello
fabriziomello

Add enhancement issue template

Add an issue template for "Enhancement" requests. An enhancement is an improvement to an existing feature or functionality. The user must pick from a set of features or subsystems to improve.

fabriziomello
fabriziomello

Add a feature request issue template

The feature request issue template adds a form for people to fill out so that we can ensure we get the information we need.

fabriziomello
fabriziomello

Add a pull request template

Add a pull request template with Guidelines for a well-formed pull request and the checklist to follow in the PR process.

fabriziomello
fabriziomello

Add configuration for the GitHub issue template chooser

Configure the GitHub issue template chooser to include options with links to the page about support requests, the Slack community, and documentation changes.

fabriziomello
fabriziomello

Properly handle max_retries option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

commit sha: a2b57fe281fdfbbc8a418ac758b024ba08182d39

push time in 4 days ago
push

fabriziomello push fabriziomello/timescaledb

fabriziomello
fabriziomello

Add enhancement issue template

Add an issue template for "Enhancement" requests. An enhancement is an improvement to an existing feature or functionality. The user must pick from a set of features or subsystems to improve.

fabriziomello
fabriziomello

Add a feature request issue template

The feature request issue template adds a form for people to fill out so that we can ensure we get the information we need.

fabriziomello
fabriziomello

Add a pull request template

Add a pull request template with Guidelines for a well-formed pull request and the checklist to follow in the PR process.

fabriziomello
fabriziomello

Add configuration for the GitHub issue template chooser

Configure the GitHub issue template chooser to include options with links to the page about support requests, the Slack community, and documentation changes.

commit sha: 1bdd825b80370dbf3b759e635b2d174034a3d8ab

push time in 4 days ago
Nov
23
5 days ago
Activity icon
issue

fabriziomello issue timescale/timescaledb

fabriziomello
fabriziomello

Add missing scripts for test_update_smoke.sh

The commit https://github.com/timescale/timescaledb/commit/e7ffedbec7c2032015a2685a7630d5efabc11244 introduced the test/sql/updates/cleanup.v2.sql script that include others that are are missing:

psql:cleanup.v2.sql:6: error: cleanup.constraints.sql: No such file or directory
psql:cleanup.v2.sql:7: error: cleanup.insert_bigint.v2.sql: No such file or directory
psql:cleanup.v2.sql:8: error: cleanup.timestamp.sql: No such file or directory
psql:cleanup.v2.sql:9: error: cleanup.insert_timestamp.sql: No such file or directory
psql:cleanup.v2.sql:10: error: cleanup.drop_meta.sql: No such file or directory
push

fabriziomello push fabriziomello/timescaledb

fabriziomello
fabriziomello

Update bug report issue template

Convert the bug report issue template into a form that the user has to fill out. The form allows making some fields required.

Also add the "bug" and "triage" labels to all bug reports. The "triage" label can be used to find bugs that haven't been triaged, assuming the label is removed as part of the triaging process.

fabriziomello
fabriziomello

Properly handle max_retries option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

commit sha: bc6df23f66b1acee37c37c6fa3586b6e908cb98d

push time in 4 days ago
push

fabriziomello push fabriziomello/timescaledb

fabriziomello
fabriziomello

Update bug report issue template

Convert the bug report issue template into a form that the user has to fill out. The form allows making some fields required.

Also add the "bug" and "triage" labels to all bug reports. The "triage" label can be used to find bugs that haven't been triaged, assuming the label is removed as part of the triaging process.

commit sha: 87a319810b2329d2298a5e460baa29b615dd80e0

push time in 4 days ago
push

fabriziomello push fabriziomello/timescaledb

fabriziomello
fabriziomello

Add an issue template for reporting flaky tests

Tests are sometimes flaky, so add an issue template to report such tests. The template ensures the issue is labeled and has the required information we need to fix the flake.

fabriziomello
fabriziomello

Properly handle max_retries option

Surprisly we're not taking care of max_retries option leading us to failed jobs running forever.

Fixed it by properly handle the max_retries option in our scheduler.

Fixes #3035

commit sha: 181fe192a116c265a54ccd0a86e49213efc1ea55

push time in 5 days ago
push

fabriziomello push fabriziomello/timescaledb

fabriziomello
fabriziomello

Add an issue template for reporting flaky tests

Tests are sometimes flaky, so add an issue template to report such tests. The template ensures the issue is labeled and has the required information we need to fix the flake.

commit sha: 9e075fa63626df32fc217fb774b7928066d97d0c

push time in 5 days ago
Previous