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

Fix incorrect "VALID UNTIL" assumption made for roles in node activation #7534

Merged
merged 4 commits into from
Mar 20, 2024

Conversation

onurctirtir
Copy link
Member

@onurctirtir onurctirtir commented Feb 23, 2024

Fixes #7533.

DESCRIPTION: Fixes incorrect VALID UNTIL setting assumption made for roles when syncing them to new nodes

Copy link

codecov bot commented Feb 23, 2024

Codecov Report

Merging #7534 (b62a573) into main (fdd658a) will decrease coverage by 0.16%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7534      +/-   ##
==========================================
- Coverage   89.68%   89.52%   -0.16%     
==========================================
  Files         283      283              
  Lines       60428    60424       -4     
  Branches     7525     7525              
==========================================
- Hits        54194    54096      -98     
- Misses       4080     4141      +61     
- Partials     2154     2187      +33     

@onurctirtir onurctirtir changed the title Fix valid until assumption made for roles in node activation Fix incorrect "VALID UNTIL" assumption made for roles in node activation Feb 23, 2024
@onurctirtir
Copy link
Member Author

Upgrade tests are still failing --need to take a closer look.

DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing SELECT worker_create_or_alter_role('user 2', 'CREATE ROLE "user 2" NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT NOLOGIN NOREPLICATION NOBYPASSRLS CONNECTION LIMIT -1 PASSWORD NULL VALID UNTIL ''infinity''', 'ALTER ROLE "user 2" NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT NOLOGIN NOREPLICATION NOBYPASSRLS CONNECTION LIMIT -1 PASSWORD NULL VALID UNTIL ''infinity''');SECURITY LABEL FOR "citus '!tests_label_provider" ON ROLE "user 2" IS 'citus ''!unclassified'
NOTICE: issuing SELECT worker_create_or_alter_role('user 2', 'CREATE ROLE "user 2" NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT NOLOGIN NOREPLICATION NOBYPASSRLS CONNECTION LIMIT -1 PASSWORD NULL', 'ALTER ROLE "user 2" NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT NOLOGIN NOREPLICATION NOBYPASSRLS CONNECTION LIMIT -1 PASSWORD NULL');SECURITY LABEL FOR "citus '!tests_label_provider" ON ROLE "user 2" IS 'citus ''!unclassified'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it maybe be VALID UNTIL NULL instead of completely removing it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe it't not valid to use NULL for valid until:

create user new_user password '12345' valid until null;
ERROR:  syntax error at or near "null"
LINE 1: create user new_user password '12345' valid until null;
                                                          ^

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe it't not valid to use NULL for valid until:

create user new_user password '12345' valid until null;
ERROR:  syntax error at or near "null"
LINE 1: create user new_user password '12345' valid until null;
                                                          ^

What do you think about this @JelteF?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, if that syntax is invalid than obviously not.

@onurctirtir onurctirtir force-pushed the fix-valid-until-inf-assumption branch from 4b94673 to 1c14872 Compare February 26, 2024 13:40
@onurctirtir onurctirtir changed the base branch from main to check-column-existence-in-xact-recovery February 26, 2024 13:41
@onurctirtir onurctirtir force-pushed the check-column-existence-in-xact-recovery branch from b540988 to 861cc92 Compare February 26, 2024 13:46
@onurctirtir onurctirtir force-pushed the fix-valid-until-inf-assumption branch from 1c14872 to 4d68745 Compare February 26, 2024 13:47
@onurctirtir onurctirtir force-pushed the check-column-existence-in-xact-recovery branch from 861cc92 to d99505f Compare February 26, 2024 13:58
@onurctirtir onurctirtir force-pushed the fix-valid-until-inf-assumption branch 2 times, most recently from c25efdd to 4ea1960 Compare February 26, 2024 14:44
@onurctirtir onurctirtir force-pushed the check-column-existence-in-xact-recovery branch from d99505f to b7cd28c Compare February 26, 2024 14:45
@onurctirtir onurctirtir marked this pull request as ready for review February 26, 2024 14:45
Copy link
Contributor

@gurkanindibay gurkanindibay left a comment

Choose a reason for hiding this comment

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

Well done :)

@onurctirtir onurctirtir force-pushed the fix-valid-until-inf-assumption branch from 4ea1960 to 0ba9820 Compare March 1, 2024 08:18
@onurctirtir onurctirtir changed the base branch from check-column-existence-in-xact-recovery to main March 1, 2024 08:18
@onurctirtir onurctirtir enabled auto-merge (squash) March 20, 2024 11:25
@onurctirtir onurctirtir merged commit 3929a5b into main Mar 20, 2024
157 checks passed
@onurctirtir onurctirtir deleted the fix-valid-until-inf-assumption branch March 20, 2024 11:38
naisila pushed a commit that referenced this pull request Jan 12, 2025
…ion (#7534)

Fixes #7533.

DESCRIPTION: Fixes incorrect `VALID UNTIL` setting assumption made for
roles when syncing them to new nodes
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.

"date" setting for the user is incorrectly set to infinity on node activation
3 participants