mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
Change replication to use read lock instead of writelock (#12581)
Fixes #12573 This PR also adding audit logging for replication activity
This commit is contained in:
committed by
GitHub
parent
ca79869078
commit
a69c2a2fb3
25
cmd/utils.go
25
cmd/utils.go
@@ -48,6 +48,7 @@ import (
|
||||
"github.com/minio/minio/internal/handlers"
|
||||
xhttp "github.com/minio/minio/internal/http"
|
||||
"github.com/minio/minio/internal/logger"
|
||||
"github.com/minio/minio/internal/logger/message/audit"
|
||||
"github.com/minio/minio/internal/rest"
|
||||
"github.com/minio/pkg/certs"
|
||||
)
|
||||
@@ -940,3 +941,27 @@ func totalNodeCount() uint64 {
|
||||
}
|
||||
return totalNodesCount
|
||||
}
|
||||
|
||||
// AuditLogOptions takes options for audit logging subsystem activity
|
||||
type AuditLogOptions struct {
|
||||
Trigger string
|
||||
APIName string
|
||||
Status string
|
||||
VersionID string
|
||||
}
|
||||
|
||||
// sends audit logs for internal subsystem activity
|
||||
func auditLogInternal(ctx context.Context, bucket, object string, opts AuditLogOptions) {
|
||||
entry := audit.NewEntry(globalDeploymentID)
|
||||
entry.Trigger = opts.Trigger
|
||||
entry.API.Name = opts.APIName
|
||||
entry.API.Bucket = bucket
|
||||
entry.API.Object = object
|
||||
if opts.VersionID != "" {
|
||||
entry.ReqQuery = make(map[string]string)
|
||||
entry.ReqQuery[xhttp.VersionID] = opts.VersionID
|
||||
}
|
||||
entry.API.Status = opts.Status
|
||||
ctx = logger.SetAuditEntry(ctx, &entry)
|
||||
logger.AuditLog(ctx, nil, nil, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user