Skip to content

Commit 11fd75b

Browse files
authored
Merge branch 'get-convex:main' into experiment-unverified-auth
2 parents aa80b03 + 6ed7a76 commit 11fd75b

File tree

203 files changed

+4157
-2284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+4157
-2284
lines changed

.github/workflows/precompile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Node setup
3030
uses: actions/setup-node@v4
3131
with:
32-
node-version-file: ".nvmrc.20"
32+
node-version-file: ".nvmrc"
3333

3434
- name: Install just
3535
uses: extractions/setup-just@v2
@@ -120,7 +120,7 @@ jobs:
120120
- name: Node setup
121121
uses: actions/setup-node@v4
122122
with:
123-
node-version-file: ".nvmrc.20"
123+
node-version-file: ".nvmrc"
124124

125125
- name: NPM install globals
126126
run: npm ci --prefix scripts

.github/workflows/release_self_hosted_images.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ on:
1010
required: true
1111
push:
1212
branches:
13-
- main
14-
paths:
15-
- "crates/model/src/migrations.rs"
13+
- release
1614

1715
jobs:
1816
release_backend:

.github/workflows/test_self_hosted_backend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
- name: Node setup
5757
uses: actions/setup-node@v4
5858
with:
59-
node-version-file: ".nvmrc.20"
59+
node-version-file: ".nvmrc"
6060

6161
- name: NPM install globals
6262
run: npm ci --prefix scripts

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.20.6
1+
20.19.5

.nvmrc.20

Lines changed: 0 additions & 1 deletion
This file was deleted.

.nvmrc.22

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.19.0

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ async_zip = { version = "0.0.17", default-features = false, features = [ "deflat
7777
async_zip_0_0_9 = { package = "async_zip", version = "0.0.9", default-features = false, features = [ "zstd", "deflate" ] }
7878
atomic_refcell = "0.1.13"
7979
aws-config = { version = "1.6", default-features = false, features = [ "client-hyper", "default-https-client", "rustls", "rt-tokio", "sso" ] }
80+
aws-credential-types = "1"
8081
aws-lc-rs = { version = "1.13", default-features = false, features = [ "aws-lc-sys", "prebuilt-nasm" ] }
8182
aws-sdk-s3 = { version = "1.83", default-features = false, features = [ "default-https-client", "rt-tokio", "sigv4a" ] }
8283
aws-smithy-http = "0.62.0"
8384
aws-smithy-types-convert = { version = "0.60", features = [ "convert-streams" ] }
84-
aws-credential-types = "1"
8585
aws-types = "1"
8686
axum = { version = "0.8", features = [ "ws", "original-uri", "macros", "multipart" ] }
8787
axum-extra = { version = "0.10", features = [ "typed-header", "cookie" ] }
@@ -103,7 +103,7 @@ compact_str = "0.9.0"
103103
const-oid = "0.9.6"
104104
const_format = { version = "0.2.34", features = [ "fmt" ] }
105105
criterion = "0.5"
106-
crossbeam-channel = "0.5"
106+
crossbeam-channel = "0.5.15"
107107
csf = "0.1.11"
108108
cstr = "0.2.11"
109109
csv-async = "1.2"

crates/application/src/function_log.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ pub struct FunctionExecution {
146146
/// Usage statistics for this instance
147147
pub usage_stats: AggregatedFunctionUsageStats,
148148
pub action_memory_used_mb: Option<u64>,
149+
/// Size of the returned value in bytes if the function execution was
150+
/// successful, excluding HTTP actions.
151+
pub return_bytes: Option<u64>,
149152

150153
/// The Convex NPM package version pushed with the module version executed.
151154
pub udf_server_version: Option<semver::Version>,
@@ -282,6 +285,7 @@ impl FunctionExecution {
282285
vector_index_read_bytes: self.usage_stats.vector_index_read_bytes,
283286
vector_index_write_bytes: self.usage_stats.vector_index_write_bytes,
284287
action_memory_used_mb: self.action_memory_used_mb,
288+
return_bytes: self.return_bytes,
285289
},
286290
},
287291
}];
@@ -647,6 +651,7 @@ impl<RT: Runtime> FunctionExecutionLog<RT> {
647651
if outcome.path.is_system() {
648652
return;
649653
}
654+
let return_bytes = outcome.result.as_ref().ok().map(|v| v.heap_size() as u64);
650655
let execution = FunctionExecution {
651656
params: UdfParams::Function {
652657
error: match &outcome.result {
@@ -668,6 +673,7 @@ impl<RT: Runtime> FunctionExecutionLog<RT> {
668673
syscall_trace: outcome.syscall_trace.clone(),
669674
usage_stats: aggregated,
670675
action_memory_used_mb: None,
676+
return_bytes,
671677
udf_server_version: outcome.udf_server_version.clone(),
672678
identity: outcome.identity.clone(),
673679
context,
@@ -801,6 +807,7 @@ impl<RT: Runtime> FunctionExecutionLog<RT> {
801807
if outcome.path.udf_path.is_system() {
802808
return;
803809
}
810+
let return_bytes = outcome.result.as_ref().ok().map(|v| v.heap_size() as u64);
804811
let execution = FunctionExecution {
805812
params: UdfParams::Function {
806813
error: outcome.result.err(),
@@ -819,6 +826,7 @@ impl<RT: Runtime> FunctionExecutionLog<RT> {
819826
syscall_trace: outcome.syscall_trace,
820827
usage_stats: aggregated,
821828
action_memory_used_mb: None,
829+
return_bytes,
822830
udf_server_version: outcome.udf_server_version,
823831
identity: outcome.identity,
824832
context,
@@ -893,6 +901,7 @@ impl<RT: Runtime> FunctionExecutionLog<RT> {
893901
if outcome.path.udf_path.is_system() {
894902
return;
895903
}
904+
let return_bytes = outcome.result.as_ref().ok().map(|v| v.heap_size() as u64);
896905
let execution = FunctionExecution {
897906
params: UdfParams::Function {
898907
error: outcome.result.err(),
@@ -911,6 +920,7 @@ impl<RT: Runtime> FunctionExecutionLog<RT> {
911920
syscall_trace: outcome.syscall_trace,
912921
usage_stats: aggregated,
913922
action_memory_used_mb: Some(completion.memory_in_mb),
923+
return_bytes,
914924
udf_server_version: outcome.udf_server_version,
915925
identity: outcome.identity,
916926
context: completion.context,
@@ -1053,6 +1063,7 @@ impl<RT: Runtime> FunctionExecutionLog<RT> {
10531063
environment: ModuleEnvironment::Isolate,
10541064
usage_stats: aggregated,
10551065
action_memory_used_mb: Some(outcome.memory_in_mb()),
1066+
return_bytes: None,
10561067
syscall_trace: outcome.syscall_trace,
10571068
udf_server_version: outcome.udf_server_version,
10581069
identity: outcome.identity,

crates/application/src/system_table_cleanup/mod.rs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ impl<RT: Runtime> SystemTableCleanupWorker<RT> {
122122
self.runtime.clone(),
123123
Quota::per_second(*SYSTEM_TABLE_ROWS_PER_SECOND),
124124
);
125+
let mut session_requests_delete_cursor = None;
125126
loop {
126127
// Jitter the wait between deletion runs to even out load.
127128
let delay = SYSTEM_TABLE_CLEANUP_FREQUENCY.mul_f32(self.runtime.rng().random());
@@ -140,15 +141,19 @@ impl<RT: Runtime> SystemTableCleanupWorker<RT> {
140141
},
141142
None => None,
142143
};
143-
self.cleanup_system_table(
144-
TableNamespace::Global,
145-
&SESSION_REQUESTS_TABLE,
146-
session_requests_cutoff
147-
.map_or(CreationTimeInterval::None, CreationTimeInterval::Before),
148-
&rate_limiter,
149-
*SESSION_CLEANUP_DELETE_CONCURRENCY,
150-
)
151-
.await?;
144+
// Preserve the deletion cursor between runs. This helps skip index tombstones.
145+
// Note that we only update the cursor after a successful run.
146+
(_, session_requests_delete_cursor) = self
147+
.cleanup_system_table(
148+
TableNamespace::Global,
149+
&SESSION_REQUESTS_TABLE,
150+
session_requests_cutoff
151+
.map_or(CreationTimeInterval::None, CreationTimeInterval::Before),
152+
&rate_limiter,
153+
*SESSION_CLEANUP_DELETE_CONCURRENCY,
154+
session_requests_delete_cursor,
155+
)
156+
.await?;
152157
}
153158
}
154159

@@ -281,9 +286,9 @@ impl<RT: Runtime> SystemTableCleanupWorker<RT> {
281286
to_delete: CreationTimeInterval,
282287
rate_limiter: &RateLimiter<RT>,
283288
num_deleters: usize,
284-
) -> anyhow::Result<usize> {
289+
mut cursor: Option<(CreationTime, ResolvedDocumentId)>,
290+
) -> anyhow::Result<(usize, Option<(CreationTime, ResolvedDocumentId)>)> {
285291
let _timer = system_table_cleanup_timer();
286-
let mut cursor = None;
287292

288293
let (tx, rx) = tokio::sync::mpsc::channel(1);
289294
let deleter = |chunk: Vec<ResolvedDocumentId>| async {
@@ -320,7 +325,7 @@ impl<RT: Runtime> SystemTableCleanupWorker<RT> {
320325
};
321326

322327
let ((), deleted) = futures::try_join!(reader, deleters)?;
323-
Ok(deleted)
328+
Ok((deleted, cursor))
324329
}
325330

326331
async fn cleanup_system_table_read_chunk(
@@ -521,13 +526,14 @@ mod tests {
521526
let rate_limiter =
522527
new_rate_limiter(rt.clone(), Quota::per_second(NonZeroU32::new(10).unwrap()));
523528

524-
let deleted = worker
529+
let (deleted, _cursor) = worker
525530
.cleanup_system_table(
526531
TableNamespace::Global,
527532
&SESSION_REQUESTS_TABLE,
528533
CreationTimeInterval::Before(cutoff),
529534
&rate_limiter,
530535
num_deleters,
536+
None,
531537
)
532538
.await?;
533539
assert_eq!(deleted, 3);

0 commit comments

Comments
 (0)