mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-28 15:09:39 -08:00
Merge pull request #200 from prometheus/feature/storage/compaction
Followup Items from Julius
This commit is contained in:
commit
958c6bb0ec
|
@ -298,7 +298,7 @@ func (w watermarkOperator) Operate(key, _ interface{}) (oErr *storage.OperatorEr
|
||||||
// An anomaly with the series frontier is severe in the sense that some sort
|
// An anomaly with the series frontier is severe in the sense that some sort
|
||||||
// of an illegal state condition exists in the storage layer, which would
|
// of an illegal state condition exists in the storage layer, which would
|
||||||
// probably signify an illegal disk frontier.
|
// probably signify an illegal disk frontier.
|
||||||
return &storage.OperatorError{err, false}
|
return &storage.OperatorError{error: err, Continuable: false}
|
||||||
}
|
}
|
||||||
|
|
||||||
curationState, err := getCurationRemark(w.curationState, w.processor, w.ignoreYoungerThan, fingerprint)
|
curationState, err := getCurationRemark(w.curationState, w.processor, w.ignoreYoungerThan, fingerprint)
|
||||||
|
@ -307,7 +307,7 @@ func (w watermarkOperator) Operate(key, _ interface{}) (oErr *storage.OperatorEr
|
||||||
// there was a decoding error with the entity and shouldn't be cause to stop
|
// there was a decoding error with the entity and shouldn't be cause to stop
|
||||||
// work. The process will simply start from a pessimistic work time and
|
// work. The process will simply start from a pessimistic work time and
|
||||||
// work forward. With an idempotent processor, this is safe.
|
// work forward. With an idempotent processor, this is safe.
|
||||||
return &storage.OperatorError{err, true}
|
return &storage.OperatorError{error: err, Continuable: true}
|
||||||
}
|
}
|
||||||
|
|
||||||
startKey := model.SampleKey{
|
startKey := model.SampleKey{
|
||||||
|
@ -318,12 +318,12 @@ func (w watermarkOperator) Operate(key, _ interface{}) (oErr *storage.OperatorEr
|
||||||
prospectiveKey, err := coding.NewProtocolBuffer(startKey.ToDTO()).Encode()
|
prospectiveKey, err := coding.NewProtocolBuffer(startKey.ToDTO()).Encode()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// An encoding failure of a key is no reason to stop.
|
// An encoding failure of a key is no reason to stop.
|
||||||
return &storage.OperatorError{err, true}
|
return &storage.OperatorError{error: err, Continuable: true}
|
||||||
}
|
}
|
||||||
if !w.sampleIterator.Seek(prospectiveKey) {
|
if !w.sampleIterator.Seek(prospectiveKey) {
|
||||||
// LevelDB is picky about the seek ranges. If an iterator was invalidated,
|
// LevelDB is picky about the seek ranges. If an iterator was invalidated,
|
||||||
// no work may occur, and the iterator cannot be recovered.
|
// no work may occur, and the iterator cannot be recovered.
|
||||||
return &storage.OperatorError{fmt.Errorf("Illegal Condition: Iterator invalidated due to seek range."), false}
|
return &storage.OperatorError{error: fmt.Errorf("Illegal Condition: Iterator invalidated due to seek range."), Continuable: false}
|
||||||
}
|
}
|
||||||
|
|
||||||
newestAllowedSample := w.stopAt
|
newestAllowedSample := w.stopAt
|
||||||
|
@ -335,7 +335,7 @@ func (w watermarkOperator) Operate(key, _ interface{}) (oErr *storage.OperatorEr
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// We can't divine the severity of a processor error without refactoring the
|
// We can't divine the severity of a processor error without refactoring the
|
||||||
// interface.
|
// interface.
|
||||||
return &storage.OperatorError{err, false}
|
return &storage.OperatorError{error: err, Continuable: false}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = w.refreshCurationRemark(fingerprint, lastTime)
|
err = w.refreshCurationRemark(fingerprint, lastTime)
|
||||||
|
@ -343,7 +343,7 @@ func (w watermarkOperator) Operate(key, _ interface{}) (oErr *storage.OperatorEr
|
||||||
// Under the assumption that the processors are idempotent, they can be
|
// Under the assumption that the processors are idempotent, they can be
|
||||||
// re-run; thusly, the commitment of the curation remark is no cause
|
// re-run; thusly, the commitment of the curation remark is no cause
|
||||||
// to cease further progress.
|
// to cease further progress.
|
||||||
return &storage.OperatorError{err, true}
|
return &storage.OperatorError{error: err, Continuable: true}
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
|
@ -45,7 +45,7 @@ type processor interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
// compactionProcessor combines sparse values in the database together such
|
// compactionProcessor combines sparse values in the database together such
|
||||||
// that at least MinimumGroupSize is fulfilled from the
|
// that at least MinimumGroupSize-sized chunks are grouped together.
|
||||||
type compactionProcessor struct {
|
type compactionProcessor struct {
|
||||||
// MaximumMutationPoolBatch represents approximately the largest pending
|
// MaximumMutationPoolBatch represents approximately the largest pending
|
||||||
// batch of mutation operations for the database before pausing to
|
// batch of mutation operations for the database before pausing to
|
||||||
|
|
Loading…
Reference in a new issue