Differentiate GET and PUT operations in the tally service (#965)

* draft of new bandwidth agreement types
* updated storagenode report for new types
* use correct pba types
This commit is contained in:
Bill Thorp 2019-01-10 06:41:57 -05:00 committed by GitHub
parent 1d741f29a7
commit fb4a11ebb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 210 additions and 144 deletions

View File

@ -243,9 +243,10 @@ func cmdDiag(cmd *cobra.Command, args []string) (err error) {
// fill the summary info
summary.TotalBytes += rbad.GetTotal()
summary.TotalTransactions++
if pbad.GetAction() == pb.PayerBandwidthAllocation_PUT {
switch pbad.GetAction() {
case pb.PayerBandwidthAllocation_PUT:
summary.PutActionCount++
} else {
case pb.PayerBandwidthAllocation_GET:
summary.GetActionCount++
}
}

View File

@ -223,10 +223,13 @@ func cmdDiag(cmd *cobra.Command, args []string) (err error) {
// Agreement is a struct that contains a bandwidth agreement and the associated signature
type SatelliteSummary struct {
TotalBytes int64
PutActionCount int64
GetActionCount int64
TotalTransactions int64
TotalBytes int64
PutActionCount int64
GetActionCount int64
GetAuditActionCount int64
GetRepairActionCount int64
PutRepairActionCount int64
TotalTransactions int64
// additional attributes add here ...
}
@ -258,25 +261,33 @@ func cmdDiag(cmd *cobra.Command, args []string) (err error) {
// fill the summary info
summary.TotalBytes += rbad.GetTotal()
summary.TotalTransactions++
if pbad.GetAction() == pb.PayerBandwidthAllocation_PUT {
switch pbad.GetAction() {
case pb.PayerBandwidthAllocation_PUT:
summary.PutActionCount++
} else {
case pb.PayerBandwidthAllocation_GET:
summary.GetActionCount++
case pb.PayerBandwidthAllocation_GET_AUDIT:
summary.GetAuditActionCount++
case pb.PayerBandwidthAllocation_GET_REPAIR:
summary.GetRepairActionCount++
case pb.PayerBandwidthAllocation_PUT_REPAIR:
summary.PutRepairActionCount++
}
}
}
// initialize the table header (fields)
const padding = 3
w := tabwriter.NewWriter(os.Stdout, 0, 0, padding, ' ', tabwriter.AlignRight|tabwriter.Debug)
fmt.Fprintln(w, "SatelliteID\tTotal\t# Of Transactions\tPUT Action\tGET Action\t")
fmt.Fprintln(w, "SatelliteID\tTotal\t# Of Transactions\tPUT Action\tGET Action\tGET (Audit) Action\tGET (Repair) Action\tPUT (Repair) Action\t")
// populate the row fields
sort.Sort(satelliteIDs)
for _, satelliteID := range satelliteIDs {
summary := summaries[satelliteID]
fmt.Fprint(w, satelliteID, "\t", summary.TotalBytes, "\t", summary.TotalTransactions, "\t", summary.PutActionCount, "\t", summary.GetActionCount, "\t\n")
fmt.Fprint(w, satelliteID, "\t", summary.TotalBytes, "\t", summary.TotalTransactions, "\t",
summary.PutActionCount, "\t", summary.GetActionCount, "\t", summary.GetAuditActionCount,
"\t", summary.GetRepairActionCount, "\t", summary.PutRepairActionCount, "\t\n")
}
// display the data

View File

@ -3,12 +3,17 @@
package accounting
import "storj.io/storj/pkg/pb"
// Constants for accounting_raw, accounting_rollup, and accounting_timestamps
const (
// AtRest is the data_type representing at-rest data calculated from pointerdb
AtRest = iota
// Bandwidth is the data_type representing bandwidth allocation.
Bandwith = iota
BandwidthPut = int(pb.PayerBandwidthAllocation_PUT)
BandwidthGet = int(pb.PayerBandwidthAllocation_GET)
BandwidthGetAudit = int(pb.PayerBandwidthAllocation_GET_AUDIT)
BandwidthGetRepair = int(pb.PayerBandwidthAllocation_GET_REPAIR)
BandwidthPutRepair = int(pb.PayerBandwidthAllocation_PUT_REPAIR)
AtRest = int(pb.PayerBandwidthAllocation_PUT_REPAIR + 1)
// LastAtRestTally represents the accounting timestamp for the at-rest data calculation
LastAtRestTally = "LastAtRestTally"
// LastBandwidthTally represents the accounting timestamp for the bandwidth allocation query

View File

@ -7,15 +7,19 @@ import (
"context"
"time"
"storj.io/storj/pkg/pb"
"storj.io/storj/pkg/storj"
)
//BWTally is a convience alias
type BWTally [pb.PayerBandwidthAllocation_PUT_REPAIR + 1]map[string]int64
// DB stores information about bandwidth usage
type DB interface {
// LastRawTime records the latest last tallied time.
LastRawTime(ctx context.Context, timestampType string) (time.Time, bool, error)
// SaveBWRaw records raw sums of agreement values to the database and updates the LastRawTime.
SaveBWRaw(ctx context.Context, latestBwa time.Time, bwTotals map[string]int64) error
SaveBWRaw(ctx context.Context, latestBwa time.Time, bwTotals BWTally) error
// SaveAtRestRaw records raw tallies of at-rest-data.
SaveAtRestRaw(ctx context.Context, latestTally time.Time, nodeData map[storj.NodeID]int64) error
}

View File

@ -56,7 +56,7 @@ func (t *tally) Run(ctx context.Context) (err error) {
}
err = t.queryBW(ctx)
if err != nil {
t.logger.Error("Query for bandwith failed", zap.Error(err))
t.logger.Error("Query for bandwidth failed", zap.Error(err))
}
select {
@ -129,7 +129,7 @@ func (t *tally) calculateAtRestData(ctx context.Context) (err error) {
}
// queryBW queries bandwidth allocation database, selecting all new contracts since the last collection run time.
// Grouping by storage node ID and adding total of bandwidth to granular data table.
// Grouping by action type, storage node ID and adding total of bandwidth to granular data table.
func (t *tally) queryBW(ctx context.Context) error {
lastBwTally, isNil, err := t.accountingDB.LastRawTime(ctx, accounting.LastBandwidthTally)
if err != nil {
@ -138,7 +138,7 @@ func (t *tally) queryBW(ctx context.Context) error {
var bwAgreements []bwagreement.Agreement
if isNil {
t.logger.Info("Tally found no existing bandwith tracking data")
t.logger.Info("Tally found no existing bandwidth tracking data")
bwAgreements, err = t.bwAgreementDB.GetAgreements(ctx)
} else {
bwAgreements, err = t.bwAgreementDB.GetAgreementsSince(ctx, lastBwTally)
@ -153,7 +153,10 @@ func (t *tally) queryBW(ctx context.Context) error {
}
// sum totals by node id ... todo: add nodeid as SQL column so DB can do this?
bwTotals := make(map[string]int64)
var bwTotals accounting.BWTally
for i := range bwTotals {
bwTotals[i] = make(map[string]int64)
}
var latestBwa time.Time
for _, baRow := range bwAgreements {
rbad := &pb.RenterBandwidthAllocation_Data{}
@ -161,10 +164,15 @@ func (t *tally) queryBW(ctx context.Context) error {
t.logger.DPanic("Could not deserialize renter bwa in tally query")
continue
}
pbad := &pb.PayerBandwidthAllocation_Data{}
if err := proto.Unmarshal(rbad.GetPayerAllocation().GetData(), pbad); err != nil {
return err
}
if baRow.CreatedAt.After(latestBwa) {
latestBwa = baRow.CreatedAt
}
bwTotals[rbad.StorageNodeId.String()] += rbad.GetTotal()
bwTotals[pbad.GetAction()][rbad.StorageNodeId.String()] += rbad.GetTotal()
}
return Error.Wrap(t.accountingDB.SaveBWRaw(ctx, lastBwTally, bwTotals))

View File

@ -4,6 +4,7 @@
package tally
import (
"context"
"crypto/ecdsa"
"testing"
"time"
@ -63,18 +64,24 @@ func TestQueryWithBw(t *testing.T) {
k, ok := fiC.Key.(*ecdsa.PrivateKey)
assert.True(t, ok)
//generate an agreement with the key
pba, err := test.GeneratePayerBandwidthAllocation(pb.PayerBandwidthAllocation_GET, k, k)
assert.NoError(t, err)
rba, err := test.GenerateRenterBandwidthAllocation(pba, teststorj.NodeIDFromString("StorageNodeID"), k)
assert.NoError(t, err)
//save to db
err = bwDb.CreateAgreement(ctx, "SerialNumber", bwagreement.Agreement{Signature: rba.GetSignature(), Agreement: rba.GetData()})
assert.NoError(t, err)
makeBWA(ctx, t, bwDb, "1", k, pb.PayerBandwidthAllocation_PUT)
makeBWA(ctx, t, bwDb, "2", k, pb.PayerBandwidthAllocation_GET)
makeBWA(ctx, t, bwDb, "3", k, pb.PayerBandwidthAllocation_GET_AUDIT)
makeBWA(ctx, t, bwDb, "4", k, pb.PayerBandwidthAllocation_GET_REPAIR)
makeBWA(ctx, t, bwDb, "5", k, pb.PayerBandwidthAllocation_PUT_REPAIR)
//check the db
err = tally.queryBW(ctx)
assert.NoError(t, err)
}
func makeBWA(ctx context.Context, t *testing.T, bwDb bwagreement.DB, serialNum string, k *ecdsa.PrivateKey, action pb.PayerBandwidthAllocation_Action) {
//generate an agreement with the key
pba, err := test.GeneratePayerBandwidthAllocation(action, k, k)
assert.NoError(t, err)
rba, err := test.GenerateRenterBandwidthAllocation(pba, teststorj.NodeIDFromString("StorageNodeID"), k)
assert.NoError(t, err)
//save to db
err = bwDb.CreateAgreement(ctx, serialNum, bwagreement.Agreement{Signature: rba.GetSignature(), Agreement: rba.GetData()})
assert.NoError(t, err)
}

View File

@ -75,7 +75,7 @@ func (cursor *Cursor) NextStripe(ctx context.Context) (stripe *Stripe, err error
}
// get pointer info
pointer, _, pba, err := cursor.pointers.Get(ctx, path)
pointer, _, _, err := cursor.pointers.Get(ctx, path)
if err != nil {
return nil, err
}
@ -100,6 +100,10 @@ func (cursor *Cursor) NextStripe(ctx context.Context) (stripe *Stripe, err error
}
authorization := cursor.pointers.SignedMessage()
pba, err := cursor.pointers.PayerBandwidthAllocation(ctx, pb.PayerBandwidthAllocation_GET_AUDIT)
if err != nil {
return nil, err
}
return &Stripe{Index: index, Segment: pointer, PBA: pba, Authorization: authorization}, nil
}

View File

@ -27,24 +27,33 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type PayerBandwidthAllocation_Action int32
const (
PayerBandwidthAllocation_PUT PayerBandwidthAllocation_Action = 0
PayerBandwidthAllocation_GET PayerBandwidthAllocation_Action = 1
PayerBandwidthAllocation_PUT PayerBandwidthAllocation_Action = 0
PayerBandwidthAllocation_GET PayerBandwidthAllocation_Action = 1
PayerBandwidthAllocation_GET_AUDIT PayerBandwidthAllocation_Action = 2
PayerBandwidthAllocation_GET_REPAIR PayerBandwidthAllocation_Action = 3
PayerBandwidthAllocation_PUT_REPAIR PayerBandwidthAllocation_Action = 4
)
var PayerBandwidthAllocation_Action_name = map[int32]string{
0: "PUT",
1: "GET",
2: "GET_AUDIT",
3: "GET_REPAIR",
4: "PUT_REPAIR",
}
var PayerBandwidthAllocation_Action_value = map[string]int32{
"PUT": 0,
"GET": 1,
"PUT": 0,
"GET": 1,
"GET_AUDIT": 2,
"GET_REPAIR": 3,
"PUT_REPAIR": 4,
}
func (x PayerBandwidthAllocation_Action) String() string {
return proto.EnumName(PayerBandwidthAllocation_Action_name, int32(x))
}
func (PayerBandwidthAllocation_Action) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{0, 0}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{0, 0}
}
type PayerBandwidthAllocation struct {
@ -59,7 +68,7 @@ func (m *PayerBandwidthAllocation) Reset() { *m = PayerBandwidthAllocati
func (m *PayerBandwidthAllocation) String() string { return proto.CompactTextString(m) }
func (*PayerBandwidthAllocation) ProtoMessage() {}
func (*PayerBandwidthAllocation) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{0}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{0}
}
func (m *PayerBandwidthAllocation) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PayerBandwidthAllocation.Unmarshal(m, b)
@ -111,7 +120,7 @@ func (m *PayerBandwidthAllocation_Data) Reset() { *m = PayerBandwidthAll
func (m *PayerBandwidthAllocation_Data) String() string { return proto.CompactTextString(m) }
func (*PayerBandwidthAllocation_Data) ProtoMessage() {}
func (*PayerBandwidthAllocation_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{0, 0}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{0, 0}
}
func (m *PayerBandwidthAllocation_Data) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PayerBandwidthAllocation_Data.Unmarshal(m, b)
@ -185,7 +194,7 @@ func (m *RenterBandwidthAllocation) Reset() { *m = RenterBandwidthAlloca
func (m *RenterBandwidthAllocation) String() string { return proto.CompactTextString(m) }
func (*RenterBandwidthAllocation) ProtoMessage() {}
func (*RenterBandwidthAllocation) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{1}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{1}
}
func (m *RenterBandwidthAllocation) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RenterBandwidthAllocation.Unmarshal(m, b)
@ -220,7 +229,7 @@ func (m *RenterBandwidthAllocation) GetData() []byte {
}
type RenterBandwidthAllocation_Data struct {
PayerAllocation *PayerBandwidthAllocation `protobuf:"bytes,1,opt,name=payer_allocation,json=payerAllocation" json:"payer_allocation,omitempty"`
PayerAllocation *PayerBandwidthAllocation `protobuf:"bytes,1,opt,name=payer_allocation,json=payerAllocation,proto3" json:"payer_allocation,omitempty"`
Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
StorageNodeId NodeID `protobuf:"bytes,3,opt,name=storage_node_id,json=storageNodeId,proto3,customtype=NodeID" json:"storage_node_id"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@ -232,7 +241,7 @@ func (m *RenterBandwidthAllocation_Data) Reset() { *m = RenterBandwidthA
func (m *RenterBandwidthAllocation_Data) String() string { return proto.CompactTextString(m) }
func (*RenterBandwidthAllocation_Data) ProtoMessage() {}
func (*RenterBandwidthAllocation_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{1, 0}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{1, 0}
}
func (m *RenterBandwidthAllocation_Data) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RenterBandwidthAllocation_Data.Unmarshal(m, b)
@ -267,9 +276,9 @@ func (m *RenterBandwidthAllocation_Data) GetTotal() int64 {
}
type PieceStore struct {
BandwidthAllocation *RenterBandwidthAllocation `protobuf:"bytes,1,opt,name=bandwidth_allocation,json=bandwidthAllocation" json:"bandwidth_allocation,omitempty"`
PieceData *PieceStore_PieceData `protobuf:"bytes,2,opt,name=piece_data,json=pieceData" json:"piece_data,omitempty"`
Authorization *SignedMessage `protobuf:"bytes,3,opt,name=authorization" json:"authorization,omitempty"`
BandwidthAllocation *RenterBandwidthAllocation `protobuf:"bytes,1,opt,name=bandwidth_allocation,json=bandwidthAllocation,proto3" json:"bandwidth_allocation,omitempty"`
PieceData *PieceStore_PieceData `protobuf:"bytes,2,opt,name=piece_data,json=pieceData,proto3" json:"piece_data,omitempty"`
Authorization *SignedMessage `protobuf:"bytes,3,opt,name=authorization,proto3" json:"authorization,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -279,7 +288,7 @@ func (m *PieceStore) Reset() { *m = PieceStore{} }
func (m *PieceStore) String() string { return proto.CompactTextString(m) }
func (*PieceStore) ProtoMessage() {}
func (*PieceStore) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{2}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{2}
}
func (m *PieceStore) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PieceStore.Unmarshal(m, b)
@ -334,7 +343,7 @@ func (m *PieceStore_PieceData) Reset() { *m = PieceStore_PieceData{} }
func (m *PieceStore_PieceData) String() string { return proto.CompactTextString(m) }
func (*PieceStore_PieceData) ProtoMessage() {}
func (*PieceStore_PieceData) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{2, 0}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{2, 0}
}
func (m *PieceStore_PieceData) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PieceStore_PieceData.Unmarshal(m, b)
@ -378,7 +387,7 @@ func (m *PieceStore_PieceData) GetContent() []byte {
type PieceId struct {
// TODO: may want to use customtype and fixed-length byte slice
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Authorization *SignedMessage `protobuf:"bytes,2,opt,name=authorization" json:"authorization,omitempty"`
Authorization *SignedMessage `protobuf:"bytes,2,opt,name=authorization,proto3" json:"authorization,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -388,7 +397,7 @@ func (m *PieceId) Reset() { *m = PieceId{} }
func (m *PieceId) String() string { return proto.CompactTextString(m) }
func (*PieceId) ProtoMessage() {}
func (*PieceId) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{3}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{3}
}
func (m *PieceId) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PieceId.Unmarshal(m, b)
@ -435,7 +444,7 @@ func (m *PieceSummary) Reset() { *m = PieceSummary{} }
func (m *PieceSummary) String() string { return proto.CompactTextString(m) }
func (*PieceSummary) ProtoMessage() {}
func (*PieceSummary) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{4}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{4}
}
func (m *PieceSummary) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PieceSummary.Unmarshal(m, b)
@ -477,9 +486,9 @@ func (m *PieceSummary) GetExpirationUnixSec() int64 {
}
type PieceRetrieval struct {
BandwidthAllocation *RenterBandwidthAllocation `protobuf:"bytes,1,opt,name=bandwidth_allocation,json=bandwidthAllocation" json:"bandwidth_allocation,omitempty"`
PieceData *PieceRetrieval_PieceData `protobuf:"bytes,2,opt,name=piece_data,json=pieceData" json:"piece_data,omitempty"`
Authorization *SignedMessage `protobuf:"bytes,3,opt,name=authorization" json:"authorization,omitempty"`
BandwidthAllocation *RenterBandwidthAllocation `protobuf:"bytes,1,opt,name=bandwidth_allocation,json=bandwidthAllocation,proto3" json:"bandwidth_allocation,omitempty"`
PieceData *PieceRetrieval_PieceData `protobuf:"bytes,2,opt,name=piece_data,json=pieceData,proto3" json:"piece_data,omitempty"`
Authorization *SignedMessage `protobuf:"bytes,3,opt,name=authorization,proto3" json:"authorization,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -489,7 +498,7 @@ func (m *PieceRetrieval) Reset() { *m = PieceRetrieval{} }
func (m *PieceRetrieval) String() string { return proto.CompactTextString(m) }
func (*PieceRetrieval) ProtoMessage() {}
func (*PieceRetrieval) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{5}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{5}
}
func (m *PieceRetrieval) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PieceRetrieval.Unmarshal(m, b)
@ -544,7 +553,7 @@ func (m *PieceRetrieval_PieceData) Reset() { *m = PieceRetrieval_PieceDa
func (m *PieceRetrieval_PieceData) String() string { return proto.CompactTextString(m) }
func (*PieceRetrieval_PieceData) ProtoMessage() {}
func (*PieceRetrieval_PieceData) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{5, 0}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{5, 0}
}
func (m *PieceRetrieval_PieceData) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PieceRetrieval_PieceData.Unmarshal(m, b)
@ -597,7 +606,7 @@ func (m *PieceRetrievalStream) Reset() { *m = PieceRetrievalStream{} }
func (m *PieceRetrievalStream) String() string { return proto.CompactTextString(m) }
func (*PieceRetrievalStream) ProtoMessage() {}
func (*PieceRetrievalStream) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{6}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{6}
}
func (m *PieceRetrievalStream) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PieceRetrievalStream.Unmarshal(m, b)
@ -634,7 +643,7 @@ func (m *PieceRetrievalStream) GetContent() []byte {
type PieceDelete struct {
// TODO: may want to use customtype and fixed-length byte slice
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Authorization *SignedMessage `protobuf:"bytes,3,opt,name=authorization" json:"authorization,omitempty"`
Authorization *SignedMessage `protobuf:"bytes,3,opt,name=authorization,proto3" json:"authorization,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -644,7 +653,7 @@ func (m *PieceDelete) Reset() { *m = PieceDelete{} }
func (m *PieceDelete) String() string { return proto.CompactTextString(m) }
func (*PieceDelete) ProtoMessage() {}
func (*PieceDelete) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{7}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{7}
}
func (m *PieceDelete) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PieceDelete.Unmarshal(m, b)
@ -689,7 +698,7 @@ func (m *PieceDeleteSummary) Reset() { *m = PieceDeleteSummary{} }
func (m *PieceDeleteSummary) String() string { return proto.CompactTextString(m) }
func (*PieceDeleteSummary) ProtoMessage() {}
func (*PieceDeleteSummary) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{8}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{8}
}
func (m *PieceDeleteSummary) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PieceDeleteSummary.Unmarshal(m, b)
@ -728,7 +737,7 @@ func (m *PieceStoreSummary) Reset() { *m = PieceStoreSummary{} }
func (m *PieceStoreSummary) String() string { return proto.CompactTextString(m) }
func (*PieceStoreSummary) ProtoMessage() {}
func (*PieceStoreSummary) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{9}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{9}
}
func (m *PieceStoreSummary) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PieceStoreSummary.Unmarshal(m, b)
@ -772,7 +781,7 @@ func (m *StatsReq) Reset() { *m = StatsReq{} }
func (m *StatsReq) String() string { return proto.CompactTextString(m) }
func (*StatsReq) ProtoMessage() {}
func (*StatsReq) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{10}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{10}
}
func (m *StatsReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StatsReq.Unmarshal(m, b)
@ -806,7 +815,7 @@ func (m *StatSummary) Reset() { *m = StatSummary{} }
func (m *StatSummary) String() string { return proto.CompactTextString(m) }
func (*StatSummary) ProtoMessage() {}
func (*StatSummary) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{11}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{11}
}
func (m *StatSummary) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StatSummary.Unmarshal(m, b)
@ -867,7 +876,7 @@ func (m *SignedMessage) Reset() { *m = SignedMessage{} }
func (m *SignedMessage) String() string { return proto.CompactTextString(m) }
func (*SignedMessage) ProtoMessage() {}
func (*SignedMessage) Descriptor() ([]byte, []int) {
return fileDescriptor_piecestore_e331a35a10004f9d, []int{12}
return fileDescriptor_piecestore_3a9e6f3a5e71f2ff, []int{12}
}
func (m *SignedMessage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SignedMessage.Unmarshal(m, b)
@ -1200,67 +1209,69 @@ var _PieceStoreRoutes_serviceDesc = grpc.ServiceDesc{
Metadata: "piecestore.proto",
}
func init() { proto.RegisterFile("piecestore.proto", fileDescriptor_piecestore_e331a35a10004f9d) }
func init() { proto.RegisterFile("piecestore.proto", fileDescriptor_piecestore_3a9e6f3a5e71f2ff) }
var fileDescriptor_piecestore_e331a35a10004f9d = []byte{
// 944 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6e, 0xdb, 0xc6,
0x13, 0x36, 0x29, 0x5b, 0x7f, 0x46, 0x96, 0xac, 0xac, 0x8d, 0xdf, 0x8f, 0x26, 0xe2, 0x5a, 0x60,
0x9a, 0x54, 0x48, 0x00, 0xb5, 0x71, 0x81, 0xde, 0x63, 0xd8, 0x28, 0x84, 0xa0, 0x8e, 0xb1, 0xb2,
0x2f, 0x39, 0x94, 0x59, 0x91, 0x13, 0x65, 0x11, 0x8a, 0x64, 0xc9, 0xa5, 0x2b, 0xf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xa5, 0x1a, 0x49, 0x46, 0x1e, 0x77, 0xe4, 0xfe, 0x53, 0x9f, 0xa0, 0x86,
0xb2, 0xbc, 0xc4, 0xd9, 0xc9, 0x4f, 0x15, 0xe8, 0x14, 0xa4, 0x53, 0xf9, 0x56, 0xc9, 0x19, 0xec,
0x48, 0x1b, 0x39, 0x2c, 0x19, 0xa5, 0x81, 0x6b, 0x7e, 0x56, 0xf6, 0x79, 0x56, 0xd4, 0x5a, 0x5b,
0xe4, 0x35, 0xd4, 0x33, 0xc1, 0x22, 0xe9, 0x6e, 0x9a, 0x49, 0xf3, 0xc9, 0xa6, 0x08, 0xa5, 0x79,
0x6b, 0xab, 0xa7, 0x7d, 0xa5, 0x91, 0x0b, 0xd8, 0x51, 0x9b, 0xe9, 0xe1, 0xba, 0x2d, 0x61, 0x3e,
0x5a, 0xe7, 0xcd, 0x2b, 0xed, 0x69, 0xe4, 0x15, 0x54, 0xb3, 0x59, 0x38, 0x2a, 0xb9, 0xa2, 0xdc,
0xe6, 0xe7, 0x6b, 0xdd, 0x45, 0xf3, 0x67, 0x69, 0x81, 0x4c, 0xc4, 0xc4, 0x5c, 0x31, 0x34, 0x99,
0x1c, 0xcd, 0xa3, 0xd5, 0xbe, 0x1c, 0xe5, 0x74, 0xfb, 0xb5, 0x1e, 0x8e, 0x46, 0x55, 0xf9, 0x8f,
0xf9, 0xf5, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5b, 0x25, 0xce, 0x20, 0x95, 0x0a, 0x00, 0x00,
var fileDescriptor_piecestore_3a9e6f3a5e71f2ff = []byte{
// 974 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xdb, 0x46,
0x10, 0x36, 0x49, 0x5b, 0xb2, 0xc6, 0x96, 0xac, 0xac, 0x8d, 0x56, 0x16, 0xe2, 0x5a, 0x60, 0x9a,
0x54, 0x48, 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0x5f, 0xd2, 0x6f,
0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x9b, 0xc8, 0x68, 0x17, 0xc4, 0x0a, 0x00, 0x00,
}

View File

@ -25,6 +25,9 @@ message PayerBandwidthAllocation { // Payer refers to satellite
enum Action {
PUT = 0;
GET = 1;
GET_AUDIT = 2;
GET_REPAIR = 3;
PUT_REPAIR = 4;
}
message Data {

View File

@ -77,7 +77,7 @@ func NewStreamReader(s *Server, stream pb.PieceStoreRoutes_StoreServer, bandwidt
return nil, err
}
if err = s.verifyPayerAllocation(pbaData, pb.PayerBandwidthAllocation_PUT); err != nil {
if err = s.verifyPayerAllocation(pbaData, "PUT"); err != nil {
return nil, err
}

View File

@ -151,7 +151,7 @@ func (s *Server) retrieveData(ctx context.Context, stream pb.PieceStoreRoutes_Re
return
}
if err = s.verifyPayerAllocation(pbaData, pb.PayerBandwidthAllocation_GET); err != nil {
if err = s.verifyPayerAllocation(pbaData, "GET"); err != nil {
allocationTracking.Fail(err)
return
}

View File

@ -13,6 +13,7 @@ import (
"os"
"path/filepath"
"regexp"
"strings"
"time"
"github.com/gtank/cryptopasta"
@ -260,13 +261,13 @@ func (s *Server) verifySignature(ctx context.Context, ba *pb.RenterBandwidthAllo
return nil
}
func (s *Server) verifyPayerAllocation(pba *pb.PayerBandwidthAllocation_Data, action pb.PayerBandwidthAllocation_Action) (err error) {
func (s *Server) verifyPayerAllocation(pba *pb.PayerBandwidthAllocation_Data, actionPrefix string) (err error) {
switch {
case pba.SatelliteId.IsZero():
return StoreError.New("payer bandwidth allocation: missing satellite id")
case pba.UplinkId.IsZero():
return StoreError.New("payer bandwidth allocation: missing uplink id")
case pba.Action != action:
case !strings.HasPrefix(pba.Action.String(), actionPrefix):
return StoreError.New("payer bandwidth allocation: invalid action %v", pba.Action.String())
}
return nil

View File

@ -33,7 +33,7 @@ func (s *Repairer) Repair(ctx context.Context, path storj.Path, lostPieces []int
defer mon.Task()(&ctx)(&err)
// Read the segment's pointer's info from the PointerDB
pr, originalNodes, pba, err := s.pdb.Get(ctx, path)
pr, originalNodes, _, err := s.pdb.Get(ctx, path)
if err != nil {
return Error.Wrap(err)
}
@ -118,9 +118,12 @@ func (s *Repairer) Repair(ctx context.Context, path storj.Path, lostPieces []int
}
signedMessage := s.pdb.SignedMessage()
pbaGet, err := s.pdb.PayerBandwidthAllocation(ctx, pb.PayerBandwidthAllocation_GET_REPAIR)
if err != nil {
return Error.Wrap(err)
}
// Download the segment using just the healthyNodes
rr, err := s.ec.Get(ctx, healthyNodes, rs, pid, pr.GetSegmentSize(), pba, signedMessage)
rr, err := s.ec.Get(ctx, healthyNodes, rs, pid, pr.GetSegmentSize(), pbaGet, signedMessage)
if err != nil {
return Error.Wrap(err)
}
@ -131,8 +134,12 @@ func (s *Repairer) Repair(ctx context.Context, path storj.Path, lostPieces []int
}
defer utils.LogClose(r)
pbaPut, err := s.pdb.PayerBandwidthAllocation(ctx, pb.PayerBandwidthAllocation_PUT_REPAIR)
if err != nil {
return Error.Wrap(err)
}
// Upload the repaired pieces to the repairNodes
successfulNodes, err := s.ec.Put(ctx, repairNodes, rs, pid, r, convertTime(pr.GetExpirationDate()), pba, signedMessage)
successfulNodes, err := s.ec.Put(ctx, repairNodes, rs, pid, r, convertTime(pr.GetExpirationDate()), pbaPut, signedMessage)
if err != nil {
return Error.Wrap(err)
}

View File

@ -14,9 +14,9 @@ import (
"storj.io/storj/internal/teststorj"
mock_overlay "storj.io/storj/pkg/overlay/mocks"
"storj.io/storj/pkg/pb"
"storj.io/storj/pkg/pointerdb/pdbclient/mocks"
mock_pointerdb "storj.io/storj/pkg/pointerdb/pdbclient/mocks"
"storj.io/storj/pkg/ranger"
"storj.io/storj/pkg/storage/ec/mocks"
mock_ecclient "storj.io/storj/pkg/storage/ec/mocks"
)
func TestNewSegmentRepairer(t *testing.T) {
@ -102,9 +102,11 @@ func TestSegmentStoreRepairRemote(t *testing.T) {
mockOC.EXPECT().BulkLookup(gomock.Any(), gomock.Any()),
mockOC.EXPECT().Choose(gomock.Any(), gomock.Any()).Return(tt.newNodes, nil),
mockPDB.EXPECT().SignedMessage(),
mockPDB.EXPECT().PayerBandwidthAllocation(gomock.Any(), gomock.Any()),
mockEC.EXPECT().Get(
gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(),
).Return(ranger.ByteRanger([]byte(tt.data)), nil),
mockPDB.EXPECT().PayerBandwidthAllocation(gomock.Any(), gomock.Any()),
mockEC.EXPECT().Put(
gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(),
).Return(tt.newNodes, nil),

View File

@ -29,7 +29,7 @@ func (db *accountingDB) LastRawTime(ctx context.Context, timestampType string) (
// SaveBWRaw records granular tallies (sums of bw agreement values) to the database
// and updates the LastRawTime
func (db *accountingDB) SaveBWRaw(ctx context.Context, latestBwa time.Time, bwTotals map[string]int64) (err error) {
func (db *accountingDB) SaveBWRaw(ctx context.Context, latestBwa time.Time, bwTotals accounting.BWTally) (err error) {
// We use the latest bandwidth agreement value of a batch of records as the start of the next batch
// This enables us to not use:
// 1) local time (which may deviate from DB time)
@ -53,14 +53,16 @@ func (db *accountingDB) SaveBWRaw(ctx context.Context, latestBwa time.Time, bwTo
}
}()
//create a granular record per node id
for k, v := range bwTotals {
nID := dbx.AccountingRaw_NodeId(k)
end := dbx.AccountingRaw_IntervalEndTime(latestBwa)
total := dbx.AccountingRaw_DataTotal(v)
dataType := dbx.AccountingRaw_DataType(accounting.Bandwith)
_, err = tx.Create_AccountingRaw(ctx, nID, end, total, dataType)
if err != nil {
return Error.Wrap(err)
for actionType, bwActionTotals := range bwTotals {
for k, v := range bwActionTotals {
nID := dbx.AccountingRaw_NodeId(k)
end := dbx.AccountingRaw_IntervalEndTime(latestBwa)
total := dbx.AccountingRaw_DataTotal(v)
dataType := dbx.AccountingRaw_DataType(actionType)
_, err = tx.Create_AccountingRaw(ctx, nID, end, total, dataType)
if err != nil {
return Error.Wrap(err)
}
}
}
//save this batch's greatest time

View File

@ -109,7 +109,7 @@ func (m *lockedAccounting) SaveAtRestRaw(ctx context.Context, latestTally time.T
}
// SaveBWRaw records raw sums of agreement values to the database and updates the LastRawTime.
func (m *lockedAccounting) SaveBWRaw(ctx context.Context, latestBwa time.Time, bwTotals map[string]int64) error {
func (m *lockedAccounting) SaveBWRaw(ctx context.Context, latestBwa time.Time, bwTotals accounting.BWTally) error {
m.Lock()
defer m.Unlock()
return m.db.SaveBWRaw(ctx, latestBwa, bwTotals)