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(rpc): set is_cloud_instance remote session var #2715

Merged
merged 5 commits into from
Feb 29, 2024

Conversation

greyscaled
Copy link
Contributor

@greyscaled greyscaled commented Feb 28, 2024

cloud_upload was working via pg proxy but not rpc (see #2714).

I saw that we do this in the pg srv handler:

.with_is_cloud_instance(is_cloud_instance, VarType::System);

and tried to find an equivalent spot in RPC code paths, though I'm not 100% on how to grok hybrid exec through the codebase.


I deployed this change to QA, and it works on Cloud QA with the CLI, and doesn't seem to unsafely set the cloud instance var:

$ cargo run --bin glaredb -- --cloud-addr=https://qa.glaredb.com
    Finished dev [unoptimized + debuginfo] target(s) in 0.32s
     Running `target/debug/glaredb '--cloud-addr=https://qa.glaredb.com'`
GlareDB (v0.8.5-24-gee80661)
Type \help for help.
> \open glaredb://<connection_string>
Connected to Cloud deployment (TLS enabled): proud_smoke
> show IS_CLOUD_INSTANCE;
┌───────────────────┐
│ is_cloud_instance │
│ ──                │
│ Utf8              │
╞═══════════════════╡
│ false             │
└───────────────────┘
> select * from cloud_upload('idk.csv');
┌─────────────────┐
│ generate_series │
│              ── │
│           Int64 │
╞═════════════════╡
│               1 │
│               2 │
│               3 │
│               4 │
│               5 │
│               6 │
│               7 │
│               8 │
│               9 │
│              10 │
└─────────────────┘
>

@greyscaled greyscaled changed the title Grey/hybrid exec file upload wip(rpc_!: set is_cloud_instance Feb 28, 2024
@greyscaled greyscaled changed the title wip(rpc_!: set is_cloud_instance wip(rpc)!: set is_cloud_instance Feb 28, 2024
@greyscaled greyscaled marked this pull request as ready for review February 28, 2024 18:34
@greyscaled greyscaled changed the title wip(rpc)!: set is_cloud_instance fix(rpc)!: set is_cloud_instance remote session var Feb 28, 2024
@greyscaled greyscaled changed the title fix(rpc)!: set is_cloud_instance remote session var fix(rpc): set is_cloud_instance remote session var Feb 28, 2024
@greyscaled greyscaled linked an issue Feb 28, 2024 that may be closed by this pull request
This reverts commit c68ab04.
@tychoish
Copy link
Collaborator

This seems fine, particularly if it works. Is there a way to write a test, or a comment (or set of comments that might prevent this kind of confusion in the future?

@greyscaled
Copy link
Contributor Author

Is there a way to write a test, or a comment (or set of comments that might prevent this kind of confusion in the future?

I'll take a stab at it, as I agree that it feels uncomfortable with the lack of testing for specific hybrid cases (#2675)

@greyscaled greyscaled merged commit c44bb5f into main Feb 29, 2024
25 checks passed
@greyscaled greyscaled deleted the grey/hybrid-exec-file-upload branch February 29, 2024 16:36
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.

cloud_upload is not available in Hybrid Exec clients
4 participants