Increment sequence, not generation
Avoid having all the new files getting picked up by the compaction planner on startup.pull/5281/head
parent
fbb3e861ca
commit
2a547b0db3
|
@ -27,7 +27,7 @@ type KeyIterator interface {
|
||||||
type Converter struct {
|
type Converter struct {
|
||||||
path string
|
path string
|
||||||
maxTSMFileSize uint32
|
maxTSMFileSize uint32
|
||||||
generation int
|
sequence int
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewConverter returns a new instance of the Converter.
|
// NewConverter returns a new instance of the Converter.
|
||||||
|
@ -92,8 +92,8 @@ func (c *Converter) Process(iter KeyIterator) error {
|
||||||
|
|
||||||
// nextTSMWriter returns the next TSMWriter for the Converter.
|
// nextTSMWriter returns the next TSMWriter for the Converter.
|
||||||
func (c *Converter) nextTSMWriter() (tsm1.TSMWriter, error) {
|
func (c *Converter) nextTSMWriter() (tsm1.TSMWriter, error) {
|
||||||
c.generation++
|
c.sequence++
|
||||||
fileName := filepath.Join(c.path, fmt.Sprintf("%09d-%09d.%s", c.generation, 0, tsm1.TSMFileExtension))
|
fileName := filepath.Join(c.path, fmt.Sprintf("%09d-%09d.%s", 1, c.sequence, tsm1.TSMFileExtension))
|
||||||
|
|
||||||
fd, err := os.OpenFile(fileName, os.O_CREATE|os.O_RDWR, 0666)
|
fd, err := os.OpenFile(fileName, os.O_CREATE|os.O_RDWR, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue