Skip to content

Commit 0fb820f

Browse files
Revert "feat(relay): inventory unreachable Git objects" (#2275)
1 parent 3afc9da commit 0fb820f

13 files changed

Lines changed: 19 additions & 700 deletions

File tree

‎.env.example‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,6 @@ RELAY_URL=ws://localhost:3000
7575
# BUZZ_GIT_PACK_CACHE_PATH=./repos/.pack-cache
7676
# BUZZ_GIT_PACK_CACHE_MAX_BYTES=5368709120
7777
# BUZZ_GIT_PACK_CACHE_MAX_CONCURRENT_POPULATIONS=2
78-
# Deployment-global dry-run inventory for future physical object-store GC.
79-
# No objects are deleted. Disabled by default.
80-
# BUZZ_GIT_GC_ENABLED=false
81-
# BUZZ_GIT_GC_INTERVAL_SECS=3600
82-
# BUZZ_GIT_GC_MAX_POINTERS=10000
83-
# BUZZ_GIT_GC_MAX_OBJECTS_PER_PREFIX=10000
84-
# BUZZ_GIT_GC_MAX_MANIFEST_BYTES_PER_SCAN=536870912
85-
# BUZZ_GIT_GC_SCAN_TIMEOUT_SECS=300
8678

8779
# -----------------------------------------------------------------------------
8880
# Media Upload Admission

‎bin/.helm-3.16.4.pkg‎

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

‎bin/helm‎

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

‎crates/buzz-db/src/lib.rs‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,16 @@ pub struct DbPoolStats {
198198
pub max: u32,
199199
}
200200

201-
/// Owns a detached Postgres session holding a relay advisory leader lock.
201+
/// Owns the detached Postgres session holding the relay usage-metrics advisory lock.
202202
///
203203
/// The connection deliberately does not return to the main pool: session advisory
204204
/// locks must remain bound to this exact physical connection, and the poller
205205
/// pings it before each leader-only collection tick.
206-
pub struct AdvisoryLockLeader {
206+
pub struct UsageMetricsLeader {
207207
connection: PgConnection,
208208
}
209209

210-
impl AdvisoryLockLeader {
210+
impl UsageMetricsLeader {
211211
/// Returns whether the lock-owning session is still reachable.
212212
///
213213
/// Bounded to 5 seconds — a blackholed connection (no RST) would otherwise
@@ -508,20 +508,23 @@ impl Db {
508508
})
509509
}
510510

511-
/// Try to acquire a detached session advisory lock for singleton relay work.
511+
/// Try to acquire the detached session advisory lock for relay usage metrics.
512512
///
513513
/// The returned guard owns the exact connection that acquired the lock. It is
514514
/// detached from the shared pool so a stable leader neither returns a locked
515515
/// session to other callers nor permanently consumes a pool slot. Dropping the
516516
/// guard closes the connection and releases the session-scoped lock.
517-
pub async fn try_advisory_lock(&self, lock_key: i64) -> Result<Option<AdvisoryLockLeader>> {
517+
pub async fn try_lock_usage_metrics(
518+
&self,
519+
lock_key: i64,
520+
) -> Result<Option<UsageMetricsLeader>> {
518521
let mut connection = self.pool.acquire().await?;
519522
let acquired = sqlx::query_scalar::<_, bool>("SELECT pg_try_advisory_lock($1)")
520523
.bind(lock_key)
521524
.fetch_one(&mut *connection)
522525
.await?;
523526
if acquired {
524-
Ok(Some(AdvisoryLockLeader {
527+
Ok(Some(UsageMetricsLeader {
525528
connection: connection.detach(),
526529
}))
527530
} else {
@@ -4660,14 +4663,14 @@ mod tests {
46604663
let key = 0x4255_5A5A_4D45_5452;
46614664

46624665
let mut leader = first
4663-
.try_advisory_lock(key)
4666+
.try_lock_usage_metrics(key)
46644667
.await
46654668
.expect("first lock attempt")
46664669
.expect("first database handle becomes leader");
46674670
assert!(leader.is_live().await, "lock owner remains reachable");
46684671
assert!(
46694672
second
4670-
.try_advisory_lock(key)
4673+
.try_lock_usage_metrics(key)
46714674
.await
46724675
.expect("second lock attempt")
46734676
.is_none(),
@@ -4677,7 +4680,7 @@ mod tests {
46774680
drop(leader);
46784681
assert!(
46794682
second
4680-
.try_advisory_lock(key)
4683+
.try_lock_usage_metrics(key)
46814684
.await
46824685
.expect("lock attempt after leader drop")
46834686
.is_some(),

0 commit comments

Comments
 (0)