Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
benbjohnson committed Aug 20, 2015
2 parents 95041aa + 63f7784 commit 28c1c0a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
1 change: 0 additions & 1 deletion cmd/influxd/run/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3026,7 +3026,6 @@ func TestServer_Query_Fill(t *testing.T) {
}

func TestServer_Query_Chunk(t *testing.T) {
t.Skip()
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
Expand Down
2 changes: 1 addition & 1 deletion shared/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h3 class="panel-title">Connection Settings</h3>
<!-- /.container -->
<div id="footer">
<div class="container">
<p class="text-muted text-right credit"><b>InfluxDB</b> v0.9.2</p>
<p class="text-muted text-right credit"><b>InfluxDB</b> v0.9.3</p>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion statik/statik.go

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions tsdb/engine/bz1/bz1.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,12 @@ func (e *Engine) Open() error {
func (e *Engine) Close() error {
e.mu.Lock()
defer e.mu.Unlock()
if err := e.close(); err != nil {

if err := e.WAL.Close(); err != nil {
return err
}
return e.WAL.Close()

return e.close()
}

func (e *Engine) close() error {
Expand Down
21 changes: 16 additions & 5 deletions tsdb/engine/wal/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,18 @@ func (l *Log) Cursor(key string) tsdb.Cursor {
}

func (l *Log) WritePoints(points []tsdb.Point, fields map[string]*tsdb.MeasurementFields, series []*tsdb.SeriesCreate) error {
partitionsToWrite := l.pointsToPartitions(points)

// persist the series and fields if there are any
if err := l.writeSeriesAndFields(fields, series); err != nil {
l.logger.Println("error writing series and fields:", err.Error())
return err
}

// get it to disk
// persist the raw point data
l.mu.RLock()
defer l.mu.RUnlock()

partitionsToWrite := l.pointsToPartitions(points)

for p, points := range partitionsToWrite {
if err := p.Write(points); err != nil {
return err
Expand Down Expand Up @@ -534,20 +535,27 @@ func (l *Log) openPartitionFiles() error {
// Close will finish any flush that is currently in process and close file handles
func (l *Log) Close() error {
// stop the autoflushing process so it doesn't try to kick another one off
l.mu.Lock()
if l.closing != nil {
close(l.closing)
l.closing = nil
}
l.mu.Unlock()

// Allow goroutines to finish running.
l.wg.Wait()

// Lock the remainder of the closing process.
l.mu.Lock()
defer l.mu.Unlock()

// clear the cache
l.partitions = nil
if err := l.close(); err != nil {
return err
}

return l.close()
l.partitions = nil
return nil
}

// close all the open Log partitions and file handles
Expand Down Expand Up @@ -745,6 +753,9 @@ func (p *Partition) Close() error {
defer p.mu.Unlock()

p.cache = nil
if p.currentSegmentFile == nil {
return nil
}
if err := p.currentSegmentFile.Close(); err != nil {
return err
}
Expand Down

0 comments on commit 28c1c0a

Please sign in to comment.