mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 18:47:20 +01:00
admin: filter plugin jobs and activities by volume id (#13077)
* admin: keep the volume id on tracked plugin jobs Volume-scoped jobs carry their volume in the volume_id parameter, but the in-memory job list drops parameters, so nothing could select a volume's jobs without reading every job detail file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: filter plugin jobs and activities by volume id /api/plugin/jobs and /api/plugin/activities accept volume_id, applied before the limit like the lane filter. Activities follow the tracked jobs of that volume. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: volume id filter on the plugin monitor A Volume ID box next to the execution state filter narrows the queue, execution jobs and activities to that volume's jobs, fetched with the volume_id API filter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: keep detection scans visible under the volume filter Detection activities belong to no job, so the volume-filtered activity window had none of them and the Detection Jobs table went empty. That table now reads its own job-type window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: accept zero-padded volume ids in the monitor filter Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: drop a monitor refresh that finishes after a newer one Two refreshes of the same scope can finish out of order; the older one then replaced the newer rows, with empty lists when its volume-filtered fetch failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: keep rows committed for the scope when a plugin monitor refresh fails A failed request fell back to the rows captured when the refresh started, so a refresh overlapping one that had already committed the new scope's rows cleared them. Resolve the fallback when the refresh commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: validate the monitor volume id before fetching Out-of-range ids went to the APIs and came back 400. The filter is now applied only from a valid change event, so the periodic refresh no longer reads a value still being typed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: volume id filter on the job queue view The queue renders the volume-scoped rows, but the only filter box sat on the execution view, so an active filter was invisible and could not be cleared there. Both views now carry a box kept in sync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: reject unparsable volume id text instead of clearing the filter A number input holding text like "1e" reports an empty value with validity.badInput set; treat it as invalid rather than as a cleared box. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ec34160a1a
commit
40a95a8ef5
7 files changed
+271
-18
No files matched your search
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/plugin_pb"
|
||||
pluginworker "github.com/seaweedfs/seaweedfs/weed/plugin/worker"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
@@ -805,6 +806,9 @@ func mergeTrackedStatusIntoDetail(detail *TrackedJob, tracked *TrackedJob) {
|
||||
if detail.DedupeKey == "" {
|
||||
detail.DedupeKey = tracked.DedupeKey
|
||||
}
|
||||
if detail.VolumeID == 0 {
|
||||
detail.VolumeID = tracked.VolumeID
|
||||
}
|
||||
if detail.Summary == "" {
|
||||
detail.Summary = tracked.Summary
|
||||
}
|
||||
@@ -942,6 +946,7 @@ func (r *Plugin) trackExecutionStart(requestID, workerID string, job *plugin_pb.
|
||||
tracked.RequestID = requestID
|
||||
tracked.WorkerID = workerID
|
||||
tracked.DedupeKey = job.DedupeKey
|
||||
tracked.VolumeID = pluginworker.ReadUint32Config(job.Parameters, "volume_id", 0)
|
||||
tracked.Summary = job.Summary
|
||||
tracked.State = strings.ToLower(plugin_pb.JobState_JOB_STATE_ASSIGNED.String())
|
||||
tracked.Progress = 0
|
||||
@@ -962,6 +967,7 @@ func (r *Plugin) trackExecutionStart(requestID, workerID string, job *plugin_pb.
|
||||
detail.RequestID = requestID
|
||||
detail.WorkerID = workerID
|
||||
detail.DedupeKey = job.DedupeKey
|
||||
detail.VolumeID = trackedSnapshot.VolumeID
|
||||
detail.Summary = job.Summary
|
||||
detail.Detail = job.Detail
|
||||
detail.Parameters = enrichTrackedJobParameters(job.JobType, configValueMapToPlain(job.Parameters))
|
||||
@@ -1017,6 +1023,7 @@ func (r *Plugin) trackExecutionQueued(job *plugin_pb.JobSpec) {
|
||||
|
||||
tracked.JobType = job.JobType
|
||||
tracked.DedupeKey = job.DedupeKey
|
||||
tracked.VolumeID = pluginworker.ReadUint32Config(job.Parameters, "volume_id", 0)
|
||||
tracked.Summary = job.Summary
|
||||
tracked.State = strings.ToLower(plugin_pb.JobState_JOB_STATE_PENDING.String())
|
||||
tracked.Progress = 0
|
||||
@@ -1034,6 +1041,7 @@ func (r *Plugin) trackExecutionQueued(job *plugin_pb.JobSpec) {
|
||||
detail.JobID = job.JobId
|
||||
detail.JobType = job.JobType
|
||||
detail.DedupeKey = job.DedupeKey
|
||||
detail.VolumeID = trackedSnapshot.VolumeID
|
||||
detail.Summary = job.Summary
|
||||
detail.Detail = job.Detail
|
||||
detail.Parameters = enrichTrackedJobParameters(job.JobType, configValueMapToPlain(job.Parameters))
|
||||
|
||||
Reference in new issue
Block a user