Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Evictor ¶
type Evictor struct {
// contains filtered or unexported fields
}
Evictor claims cache eviction tasks and removes remotely durable objects according to the configured policy.
func NewEvictor ¶
func NewEvictor( repos *repository.Repositories, c cache.Cache, cacheGate *cacheaccess.Gate, cacheAccessTracker *cacheaccess.Tracker, sm *state.Machine, concurrency int, pollInterval time.Duration, logger *slog.Logger, opts ...EvictorOption, ) *Evictor
NewEvictor creates a new cache evictor worker.
type EvictorOption ¶
type EvictorOption func(*Evictor)
EvictorOption configures cache eviction behavior.
func WithCacheEvictionPolicy ¶
func WithCacheEvictionPolicy( policy cache.EvictionPolicy, maxCacheBytes int64, highWatermarkPercent int, lowWatermarkPercent int, maxRetries int, ) EvictorOption
WithCacheEvictionPolicy configures the eviction strategy and LRU capacity thresholds. The thresholds are ignored outside LRU mode.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager coordinates the lifecycle of all background workers.
func NewManager ¶
func NewManager(repos *repository.Repositories, logger *slog.Logger, evictionPolicy cache.EvictionPolicy, workers ...Worker) *Manager
NewManager creates a new worker manager.
func (*Manager) WithProviderReplacementRecovery ¶
func (m *Manager) WithProviderReplacementRecovery(maxRetries int, retryInterval time.Duration) *Manager
WithProviderReplacementRecovery configures provider replacement startup recovery.
func (*Manager) WithTaskMaxRetries ¶
WithTaskMaxRetries configures max retries for tasks recreated during startup reconciliation.
func (*Manager) WorkerHealth ¶
WorkerHealth returns a map of worker name → healthy status.
type ProviderReplacementWorker ¶
type ProviderReplacementWorker struct {
// contains filtered or unexported fields
}
ProviderReplacementWorker processes provider replacement items.
func NewProviderReplacementWorker ¶
func NewProviderReplacementWorker( repos *repository.Repositories, uploadSupport *Uploader, concurrency int, pollInterval time.Duration, logger *slog.Logger, ) *ProviderReplacementWorker
func (*ProviderReplacementWorker) Healthy ¶
func (w *ProviderReplacementWorker) Healthy() bool
func (*ProviderReplacementWorker) Name ¶
func (w *ProviderReplacementWorker) Name() string
type ReplacementTransferExecutor ¶
type ReplacementTransferExecutor struct {
// contains filtered or unexported fields
}
ReplacementTransferExecutor processes one claimed replacement item.
func NewReplacementTransferExecutor ¶
func NewReplacementTransferExecutor( repos *repository.Repositories, uploadSupport *Uploader, registry *replacementTargetContextRegistry, logger *slog.Logger, ) *ReplacementTransferExecutor
func (*ReplacementTransferExecutor) Execute ¶
func (e *ReplacementTransferExecutor) Execute(ctx context.Context, item *storagereplacement.Item) (int64, error)
type StorageCleanupOption ¶
type StorageCleanupOption func(*StorageCleanupWorker)
StorageCleanupOption configures optional cleanup dependencies.
func WithServiceTermination ¶
func WithServiceTermination(terminator synapse.ServiceTerminator, epochs synapse.ChainEpochReader) StorageCleanupOption
WithServiceTermination enables provider replacement retirement. Without it the worker still removes pieces but refuses to end any service.
type StorageCleanupWorker ¶
type StorageCleanupWorker struct {
// contains filtered or unexported fields
}
func NewStorageCleanupWorker ¶
func NewStorageCleanupWorker(repos *repository.Repositories, storageClient synapse.StorageClient, concurrency int, pollInterval time.Duration, logger *slog.Logger, opts ...StorageCleanupOption) *StorageCleanupWorker
func (*StorageCleanupWorker) Healthy ¶
func (w *StorageCleanupWorker) Healthy() bool
func (*StorageCleanupWorker) Name ¶
func (w *StorageCleanupWorker) Name() string
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
Uploader claims upload tasks, persists upload provenance, and accepts complete uploads for object versions.
func NewUploader ¶
func NewUploader(repos *repository.Repositories, c cache.Cache, sc synapse.StorageClient, wallet synapse.WalletQuerier, sm *state.Machine, evictionPolicy cache.EvictionPolicy, targetCopies int, concurrency int, pollInterval time.Duration, logger *slog.Logger, opts ...UploaderOption) *Uploader
NewUploader creates a new upload worker.
type UploaderOption ¶
type UploaderOption func(*Uploader)
UploaderOption configures uploader behavior.
func WithEventPublisher ¶
func WithEventPublisher(publisher admin.EventPublisher) UploaderOption
func WithEvictMaxRetries ¶
func WithEvictMaxRetries(maxRetries int) UploaderOption
WithEvictMaxRetries configures max retries for cache eviction tasks created after upload.
func WithPDPStatusChecker ¶
func WithPDPStatusChecker(checker *synapse.PDPStatusChecker) UploaderOption
WithPDPStatusChecker configures the client used to resume submitted commits.
func WithProviderReplacementMaxRetries ¶
func WithProviderReplacementMaxRetries(maxRetries int) UploaderOption
WithProviderReplacementMaxRetries sets the provider replacement retry limit.
type WalletOperationRunner ¶
type WalletOperationRunner struct {
// contains filtered or unexported fields
}
func NewWalletOperationRunner ¶
func NewWalletOperationRunner( repos *repository.Repositories, operator synapse.WalletOperator, receipts WalletReceiptChecker, pollInterval time.Duration, logger *slog.Logger, opts ...WalletOperationRunnerOption, ) *WalletOperationRunner
func (*WalletOperationRunner) Healthy ¶
func (r *WalletOperationRunner) Healthy() bool
func (*WalletOperationRunner) Name ¶
func (r *WalletOperationRunner) Name() string
type WalletOperationRunnerOption ¶
type WalletOperationRunnerOption func(*WalletOperationRunner)
func WithWalletOperationEventPublisher ¶
func WithWalletOperationEventPublisher(publisher admin.EventPublisher) WalletOperationRunnerOption
func WithWalletOperationTimeouts ¶
func WithWalletOperationTimeouts(broadcast, receipt time.Duration) WalletOperationRunnerOption
type WalletReceiptChecker ¶
type Worker ¶
type Worker interface {
// Name returns a human-readable identifier.
Name() string
// Run starts the worker loop; it should block until ctx is cancelled.
Run(ctx context.Context) error
// Healthy returns true if the worker has ticked recently.
Healthy() bool
}
Worker defines a background processing unit.
Source Files
¶
- backoff.go
- evictor.go
- evictor_after_upload.go
- evictor_finalize.go
- evictor_lru.go
- evictor_reconcile.go
- health.go
- manager.go
- poll_sleep.go
- provider_replacement_worker.go
- revert.go
- storage_cleanup.go
- storage_cleanup_replacement.go
- task_lease.go
- task_status.go
- uploader.go
- uploader_replacement.go
- uploader_replica_repair.go
- wallet_operation_runner.go