Skip to content

Commit b56019c

Browse files
NathanFlurryMasterPtato
authored andcommitted
temp: fix schema
1 parent 3f7723c commit b56019c

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

packages/core/api/actor/src/route/logs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ pub async fn export_logs(
297297
presigned_endpoint_kind: Some(backend::pkg::upload::prepare::EndpointKind::Internal as i32),
298298
})
299299
.await?;
300+
let upload_id = unwrap!(upload_res.upload_id).as_uuid();
300301

301302
let presigned_req = unwrap!(upload_res.presigned_requests.first());
302303

@@ -332,7 +333,7 @@ pub async fn export_logs(
332333
let presigned_req = s3_client
333334
.get_object()
334335
.bucket(s3_client.bucket())
335-
.key(filename)
336+
.key(format!("{upload_id}/{filename}"))
336337
.presigned(
337338
s3_util::aws_sdk_s3::presigning::PresigningConfig::builder()
338339
.expires_in(Duration::from_secs(60 * 60))

packages/edge/services/pegboard/db/actor-log/migrations/20250703195340_fix_actor_logs3_metadata.up.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ AS SELECT
3232
a.client_id,
3333
a.durable
3434
FROM actor_logs3 l
35-
LEFT JOIN db_pegboard_analytics.actors a ON l.namespace = a.namespace AND l.env_id = a.env_id AND l.actor_id = a.actor_id;
35+
ANY LEFT JOIN db_pegboard_analytics.actors a ON l.namespace = a.namespace AND l.env_id = a.env_id AND l.actor_id = a.actor_id;
3636

packages/edge/services/pegboard/db/analytics/migrations/20200101000000_init.up.sql

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@ CREATE TABLE IF NOT EXISTS actors
5151
connectable_at DateTime64(9),
5252
finished_at DateTime64(9),
5353
destroyed_at DateTime64(9),
54-
row_updated_at DateTime64(9),
55-
56-
INDEX idx_actor_id actor_id TYPE bloom_filter GRANULARITY 1
54+
row_updated_at DateTime64(9)
5755
)
5856
ENGINE = ReplicatedReplacingMergeTree(row_updated_at)
59-
PARTITION BY (namespace, env_id, toStartOfHour(created_at))
60-
ORDER BY (env_id, created_at, actor_id)
57+
PARTITION BY (namespace, env_id, toStartOfMonth(created_at))
58+
ORDER BY (namespace, env_id, actor_id, row_updated_at)
6159
TTL toDate(multiIf(destroyed_at > 0, destroyed_at + toIntervalDay(90), toDateTime64('2099-12-31 23:59:59', 9)))
62-
SETTINGS index_granularity = 8192, ttl_only_drop_parts = 0;
60+
SETTINGS index_granularity = 4096, ttl_only_drop_parts = 0;

packages/edge/services/pegboard/src/ops/actor/log/read_with_query.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use chirp_workflow::prelude::*;
22
use clickhouse_user_query::{QueryExpr, UserDefinedQueryBuilder};
33

44
use crate::schema::ACTOR_LOGS_SCHEMA;
5-
use crate::types::LogsStreamType;
65

76
#[derive(Debug)]
87
pub struct Input {
@@ -96,8 +95,6 @@ pub async fn pegboard_actor_log_read_with_query(
9695
WHERE
9796
namespace = ?
9897
AND env_id = ?
99-
AND actor_id IN ?
100-
AND stream_type IN ?
10198
-- Apply timestamp filtering based on query type
10299
AND (
103100
? -- is_all

shell.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ in
2626
git-lfs
2727
jq
2828
openssh # ssh-keygen
29+
go-migrate
2930

3031
# Compilers
3132
clang

0 commit comments

Comments
 (0)