Skip to content

Refresh folder and bucket usage on demand with optional event-driven updates - #70

Merged
Vonng merged 5 commits into
pgsty:mainfrom
cyberbret:feat/folder-size-summaries
Nov 4, 2026
Merged

Vonng merged 5 commits into
pgsty:mainfrom
cyberbret:feat/folder-size-summaries

Conversation

@cyberbret

@cyberbret cyberbret commented Oct 26, 2026 •

Copy link
Copy Markdown

Folder prefixes have no stored size, and server scanner snapshots can lag behind object changes. Add fresh metadata scans to Refresh, visible progress and completion times, and separate current-object and retained-version totals.

The folder browser supports recursive NDJSON scans, per-folder calculation, cancellation and disconnect cleanup. Current and retained bytes, version counts and delete markers remain distinct; partial, failed or limited scans never become completed zero totals. Decimal-string bytes preserve precision, including sorting above JavaScript’s safe integer range.

Optionally run console usage-worker with PostgreSQL for durable bucket refresh and automatic updates. S3 mutation notifications invalidate only affected buckets. Repeated events coalesce into priority work, leased workers resume at whole-key/version boundaries, and changes during a scan request a follow-up generation. Frequent inventory discovery leaves unchanged buckets alone; startup/reconnect and independently configured full reconciliation repair gaps in the non-replayable live stream. Without the database, Refresh uses bounded foreground scans and clearly marks automatic updates as unconfigured.

The worker uses a dedicated metadata-list/notification identity with no object reads, writes or administrative privileges. Browser requests independently check the signed-in caller’s root and version-list requests before exposing cached aggregates. Readiness includes event coverage and reconciliation; internal metrics report queue age, failure/limit states and observer health. Budgets, concurrency, lease/retry intervals and polling are configurable. See docs/FolderSizes.md for the API, permissions, limitations and setup.

Validation:

  • Complete Go test suite and API/worker vet.
  • All 641 frontend unit/browser-harness checks, TypeScript checking and bundle budgets.
  • Real PostgreSQL queue, coalescing, lease-fencing, fairness, checkpoint and inventory-discovery tests.
  • Native SILO integration covering mutation events, missed-event recovery, metadata-only permissions, and one key spanning more than 1,000 versions.
  • Six exact-image browser acceptance checks, including bucket/folder Refresh and automatic UI updates without Refresh.
  • Internal production acceptance: priority refresh matched an independent S3 listing; an actual object write changed the displayed current/retained totals without Refresh; the dedicated metadata identity was denied object reads and writes. Temporary fixture versions and bucket were removed. Both Console replicas and the worker are healthy, Prometheus scrapes the worker, and the matching corresponding-source archive was checked. The storage server and operator data were preserved.

Source changes and regenerated optimized embedded GUI assets are separate DCO-signed commits. Existing licenses/notices remain intact. No deployment configuration, credentials or operator data is included.

@cyberbret cyberbret changed the title Calculate folder sizes on demand with progress and retained-version totals Refresh folder and bucket usage on demand with optional event-driven updates Oct 27, 2026

@Vonng Vonng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useful feature, but three reproduced correctness problems need fixes before merge (inline). go test ./..., go test -race ./api ./pkg/usage, and the existing focused PostgreSQL queue/scan/observer/health tests pass. Two added PostgreSQL regression checks and one Chromium refresh regression fail on this head. CI currently awaits maintainer approval.

Please retain these regression cases and add the integration-tagged PostgreSQL suite to CI. The new operator guide belongs in the companion documentation site, with a canonical link here, per CONTRIBUTING.md.

Comment thread pkg/usage/scan.go Resolved
Comment thread pkg/usage/worker.go Resolved

Vonng commented Nov 4, 2026

Copy link
Copy Markdown
Member

Additional validation on the same d47e654 head: the complete go test -tags=integration,storageintegration ./pkg/usage -count=1 -v suite passes against disposable PostgreSQL 18 and the maintained SILO binary (24 top-level tests, including metadata-only credentials, event recovery and 1,000+ versions). This confirms the baseline feature path works, but does not cover or resolve the three reproduced regressions in the requested-changes review.

@Vonng
Vonng merged commit 4b6fa64 into pgsty:main Nov 4, 2026
Vonng added a commit that referenced this pull request Nov 4, 2026
…age scans

Preserve PR #70's original commits and incorporate the reviewed creation, quota, formatting and usage reliability fixes.

Validated final head 08fcde6: Required matrix and Vulnerability Check passed, including 824 Playwright tests and 8 group-permission regressions.

Signed-off-by: Feng Ruohang <[email protected]>

Vonng commented Nov 4, 2026

Copy link
Copy Markdown
Member

Integrated into main through #79 at 5175e5c. All five original commits, including d47e654, remain in the merge history with their authorship and sign-offs.

Follow-up fixes preserve full-scan deadlines across checkpoints, renew observer leases during slow reconciliation, and retain completed foreground totals across transient failures while clearing inaccessible data. The three review threads now contain the regression evidence and are resolved.

The final required workflow and vulnerability check passed, including PostgreSQL/native SILO race tests, 824 Playwright tests and 8 additional group-permission regressions. The canonical usage guide is published in English and Chinese, and contributor credit is included.

These changes are merged source for the next release; this merge does not publish a new Console binary or image.

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.

2 participants