Commit Graph

6874 Commits (d371a31f8f93aa1c2ee8954b07fd8755166058fd)

Author SHA1 Message Date
gurkanindibay d371a31f8f Fixes test placement 2024-01-31 19:44:13 +03:00
gurkanindibay 4c3256903e Fixes flaky test outputs 2024-01-31 18:25:33 +03:00
gurkanindibay 8179cf7e39 Fixes role operations error 2024-01-31 18:16:48 +03:00
gurkanindibay e0c189c1a1 Fixes test problems 2024-01-31 18:14:26 +03:00
gurkanindibay b168b275e2 Fixes sql snapshot error 2024-01-31 17:26:46 +03:00
gurkanindibay dd45a2c874 Fixes drop role pg_dist_object removal issue 2024-01-31 17:22:16 +03:00
gurkanindibay c57d642408 Merges with prev branches 2024-01-30 00:07:06 +03:00
Gürkan İndibay e7b389f420
Merge branch 'grant_database_2pc' into create_user_2pc 2024-01-29 23:32:37 +03:00
gurkanindibay 9a2cabec8f Merge branch 'grant_role_2pc' into grant_database_2pc 2024-01-29 23:28:33 +03:00
gurkanindibay 848cf685c2 Changes postprocess logic 2024-01-29 23:26:05 +03:00
gurkanindibay 1ed2f915d2 Fixes merge problems 2024-01-29 23:22:21 +03:00
Gürkan İndibay a759aaf797
Merge branch 'grant_role_2pc' into grant_database_2pc 2024-01-29 22:18:05 +03:00
Gürkan İndibay fb1030f238
Merge branch 'main' into grant_role_2pc 2024-01-29 22:11:55 +03:00
gurkanindibay 4553e1ea5b Fixes indentation 2024-01-29 17:57:09 +03:00
gurkanindibay 71a733cdec Fixes indentation 2024-01-29 17:50:52 +03:00
gurkanindibay 754d5899f2 Refactors MarkObjectDistributed logic 2024-01-29 17:50:27 +03:00
gurkanindibay e2e868166c Fixes naming suggestions 2024-01-29 16:34:37 +03:00
Gürkan İndibay 510e5581ad
Update src/backend/distributed/commands/utility_hook.c
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2024-01-29 16:33:49 +03:00
Gürkan İndibay 2f45493366
Update src/backend/distributed/commands/utility_hook.c
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2024-01-29 16:33:42 +03:00
Gürkan İndibay 42864d7069
Update src/backend/distributed/commands/utility_hook.c
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2024-01-29 16:33:27 +03:00
Gürkan İndibay 9632798dc5
Update src/backend/distributed/commands/utility_hook.c
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2024-01-29 16:32:54 +03:00
gurkanindibay fda16d99d9 Adds metadatasync 2024-01-29 15:33:44 +03:00
Gürkan İndibay 3533461712
Update src/backend/distributed/commands/utility_hook.c
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2024-01-29 13:16:27 +03:00
Gürkan İndibay 58bddca01c
Update src/backend/distributed/commands/utility_hook.c
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2024-01-29 13:16:14 +03:00
gurkanindibay 172f866ba6 Adds command propagation 2024-01-26 19:14:30 +03:00
Onur Tirtir 9c243d4477
Improve check_gucs_are_alphabetically_sorted.sh (#7460)
Apparently https://github.com/citusdata/citus/pull/7452 was not enough,
need to consider the GUC-like expressions only within
RegisterCitusConfigVariables
function.
2024-01-26 12:10:35 +00:00
Gürkan İndibay 3189159703
Merge branch 'main' into grant_role_2pc 2024-01-26 15:02:52 +03:00
gurkanindibay 7fc04e3b46 Merge branch 'grant_role_2pc' into grant_database_2pc 2024-01-26 11:46:18 +03:00
eaydingol 5d673874f7
Move citus internal functions (#7456)
Move citus_internal_acquire_citus_advisory_object_class_lock and
citus_internal_add_colocation_metadata functions from pg_catalog to
citus_internal.

#7405
2024-01-26 11:46:05 +03:00
gurkanindibay 29e1c0c5f9 Adds metadata_sync tests 2024-01-26 11:04:54 +03:00
gurkanindibay cf50b0cea9 Merge branch 'grant_role_2pc' into grant_database_2pc 2024-01-26 09:57:25 +03:00
Onur Tirtir 24188959ed
Improve the script that sorts GUCs in alphabetical order (#7452)
Soon we will have occurrences of "citus.X" in shared_library_init.c that
are not part of GUC defs, so we need to use a more precise regular
expression.
2024-01-25 11:22:39 +03:00
gurkanindibay eba3553ada Changes test order 2024-01-24 21:48:11 +03:00
gurkanindibay 016081a496 Fixes test error 2024-01-24 21:18:11 +03:00
Gürkan İndibay ee59e7eaf5
Merge branch 'main' into grant_role_2pc 2024-01-25 16:00:21 +03:00
gurkanindibay 9a0259cf3e Adds metadata sync tests 2024-01-24 17:47:39 +03:00
eaydingol 542212c3d8
Make citus_internal schema public (#7450)
DESCRIPTION: Makes citus_internal schema public



#7405
2024-01-24 17:11:10 +03:00
Onur Tirtir 3de5601bcc
Replace LOCAL_HOST_NAME with LocalHostName (#7449)
The only usages of LOCAL_HOST_NAME were in functions that are only used
during regression tests and in places where it was used incorrectly.
2024-01-24 13:50:39 +00:00
Onur Tirtir 1d096df7f4
Not use hardcoded LOCAL_HOST_NAME but citus.local_hostname to distinguish loopback connections (#7436)
Fixes a bug that breaks queries from non-maindbs when
citus.local_hostname is set to a value different than "localhost".

This is a very old bug doesn't cause a problem as long as Citus catalog
is available to FindWorkerNode(). And the catalog is always available
unless we're in non-main database, which might be the case on main but
not on older releases, hence not adding a `DESCRIPTION`. For this
reason, I don't see a reason to backport this.

Maybe we should totally refrain using LOCAL_HOST_NAME in all code-paths,
but not doing that in this PR as the other paths don't seem to be
breaking something that is user-facing.

```c
char *
GetAuthinfo(char *hostname, int32 port, char *user)
{
	char *authinfo = NULL;
	bool isLoopback = (strncmp(LOCAL_HOST_NAME, hostname, MAX_NODE_LENGTH) == 0 &&
					   PostPortNumber == port);

	if (IsTransactionState())
	{
		int64 nodeId = WILDCARD_NODE_ID;

		/* -1 is a special value for loopback connections (task tracker) */
		if (isLoopback)
		{
			nodeId = LOCALHOST_NODE_ID;
		}
		else
		{
			WorkerNode *worker = FindWorkerNode(hostname, port);
			if (worker != NULL)
			{
				nodeId = worker->nodeId;
			}
		}

		authinfo = GetAuthinfoViaCatalog(user, nodeId);
	}

	return (authinfo != NULL) ? authinfo : "";
}
```
2024-01-24 12:58:55 +00:00
Filip Sedlák 8b48d6ab02
Log username in the failed connection message (#7432)
This patch includes the username in the reported error message.
This makes debugging easier when certain commands open connections
as other users than the user that is executing the command.

```
monitora_snapshot=# SELECT citus_move_shard_placement(102030, 'monitora.db-dev-worker-a', 6005, 'monitora.db-dev-worker-a', 6017);
ERROR:  connection to the remote node monitora_user@monitora.db-dev-worker-a:6017 failed with the following error: fe_sendauth: no password supplied
Time: 40,198 ms
```
2024-01-24 11:24:23 +00:00
Halil Ozan Akgül 1cb2e1e4e8
Fixes create user queries from Citus non-main databases with other users (#7442)
This PR makes the connections to other nodes for
`mark_object_distributed` use the same user as
`execute_command_on_remote_nodes_as_user` so they'll use the same
connection.
2024-01-24 12:57:54 +03:00
Gokhan Gulbiz 3ffb831beb
Update contributing docs (#7447)
This is a minor change to use a generic name instead of our legacy CI
provider name in the contributing documentation.
2024-01-24 09:50:49 +01:00
Gürkan İndibay 863713e9b7
Refactors ExtendedTaskList methods (#7372)
ExecuteTaskListIntoTupleDestWithParam and ExecuteTaskListIntoTupleDest
are nearly the same. I parameterized and a made a reusable structure
here

---------

Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2024-01-24 06:00:19 +00:00
Teja Mupparti 11d7c27352 Fix assertions in other PG versions too, the original fix is in PR-7379 2024-01-23 15:10:06 -08:00
gurkanindibay 42105686a3 Fixes code style 2024-01-23 16:42:49 +03:00
gurkanindibay 2da1fb1ff8 Adds comnment for the new method 2024-01-23 16:07:55 +03:00
gurkanindibay f7dce78534 Refactors Object Type check code 2024-01-23 16:07:15 +03:00
Jelte Fennema-Nio 9683bef2ec
Replace more spurious strdups with pstrdups (#7441)
DESCRIPTION: Remove a few small memory leaks

In #7440 one instance of a strdup was removed. But there were a few
more. This removes the ones that are left over, or adds a comment why
strdup is on purpose.
2024-01-23 13:28:26 +01:00
gurkanindibay 20caccb408 Adds grant database 2pc support 2024-01-23 14:55:13 +03:00
Marco Slot 72fbea20c4
Replace spurious strdup with pstrdup (#7440)
Not sure why we never found this using valgrind, but using strdup will
cause memory leaks because the pointer is not tracked in a memory
context.
2024-01-23 11:55:03 +01:00