Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit 844eb62

Browse files
authored
Merge pull request #1494 from codysoyland/release-1.0.1
Release 1.0.1
2 parents 2d903e3 + 2ea24d6 commit 844eb62

13 files changed

+158
-52
lines changed

CHANGELOG.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [v1.0.1] - 2018-07-11
9+
10+
This version contains 12 contributions from 4 contributors. There are 11 files changed, 133 insertions, and 39 deletions.
11+
12+
### Fixed
13+
14+
- Use `dep ensure -vendor-only` for build repeatability ([#1491](https://github.com/pilosa/pilosa/pull/1491))
15+
- Make sure time range views are calculated correctly across months ([#1485](https://github.com/pilosa/pilosa/pull/1485))
16+
- Fix up error handling, add a configurable timeout to http handler closing ([#1486](https://github.com/pilosa/pilosa/pull/1486))
17+
- Add gossip Closer ([#1483](https://github.com/pilosa/pilosa/pull/1483))
18+
- Update docs references to WebUI naming (console) and installation ([#1493](https://github.com/pilosa/pilosa/pull/1493))
19+
820
## [v1.0.0] - 2018-07-09
921

1022
This version contains 218 contributions from 7 contributors. There are 184 files changed, 21,769 insertions, and 20,275 deletions.
@@ -55,7 +67,7 @@ This version contains 218 contributions from 7 contributors. There are 184 files
5567

5668
## [v0.10.0] - 2018-05-15
5769

58-
This version contains 93 contribution from 8 contributors. There are 93 files changed, 4,495 insertions, and 5,392 deletions.
70+
This version contains 93 contributions from 8 contributors. There are 93 files changed, 4,495 insertions, and 5,392 deletions.
5971

6072
### Added
6173

@@ -86,7 +98,7 @@ This version contains 93 contribution from 8 contributors. There are 93 files ch
8698

8799
## [v0.9.0] - 2018-05-04
88100

89-
This version contains 188 contribution from 12 contributors. There are 141 files changed, 17,832 insertions, and 7,503 deletions.
101+
This version contains 188 contributions from 12 contributors. There are 141 files changed, 17,832 insertions, and 7,503 deletions.
90102

91103
*Please see special [upgrading instructions](https://www.pilosa.com/docs/latest/administration/#version-0-9) for this release.*
92104

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ clean:
2525
# Set up vendor directory using `dep`
2626
vendor: Gopkg.toml
2727
$(MAKE) require-dep
28-
dep ensure
28+
dep ensure -vendor-only
2929
touch vendor
3030

3131
# Run test suite

docs/webui.md docs/console.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
11
+++
2-
title = "WebUI"
2+
title = "Console"
33
weight = 9
44
nav = [
5-
"Console",
5+
"Installation",
6+
"Query",
67
"Cluster Admin",
78
]
89
+++
910

10-
## WebUI
11+
## Console
1112

12-
A web-based app called Pilosa WebUI is available in a separate package. This can be used for constructing queries and viewing the cluster status.
13+
A web-based app called Pilosa Console is available in a separate package. This can be used for constructing queries and viewing the cluster status.
1314

1415
### Installation
1516

16-
Releases are [available on Github](https://github.com/pilosa/webui/releases) as well as on [Homebrew](https://brew.sh/) for Mac.
17+
Releases are [available on Github](https://github.com/pilosa/console/releases) as well as on [Homebrew](https://brew.sh/) for Mac.
1718

1819
Installing on a Mac with Homebrew is simple; just run:
1920

2021
```
21-
brew install pilosa-webui
22+
brew tap pilosa/homebrew-pilosa
23+
brew install pilosa-console
2224
```
2325

24-
You may also build from source by checking out the [repo on Github](https://github.com/pilosa/webui) and running:
26+
You may also build from source by checking out the [repo on Github](https://github.com/pilosa/console) and running:
2527

2628
```
2729
make install
2830
```
2931

30-
### Console
32+
### Query
3133

32-
The Console view allows you to enter [PQL](../query-language/) queries and run them against your locally running server. First you must select an Index with the Select index dropdown.
34+
The Query tab allows you to enter [PQL](../query-language/) queries and run them against your locally running server. First you must select an Index with the Select index dropdown.
3335

3436
Each query's result will be displayed in the Output section along with the query time.
3537

3638
The Console will keep a record of each query and its result with the latest query on top.
3739

38-
![webUI console screenshot](/img/docs/webui-console.png)
39-
*WebUI console screenshot*
40+
![Console screenshot](/img/docs/webui-console.png)
41+
*Console query screenshot*
4042

4143
In addition to standard PQL, the console supports a few special commands, prefixed with `:`.
4244

docs/installation.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ There are four ways to install Pilosa on MacOS: Use [Homebrew](https://brew.sh/)
4242
backing up, and more. Complete documentation is available
4343
at https://www.pilosa.com/docs/.
4444
45-
Version: v1.0.0
45+
Version: v1.0.1
4646
Build Time: 2018-05-14T22:14:01+0000
4747
4848
Usage:
@@ -71,19 +71,19 @@ There are four ways to install Pilosa on MacOS: Use [Homebrew](https://brew.sh/)
7171
7272
1. Download the latest release:
7373
```
74-
curl -L -O https://github.com/pilosa/pilosa/releases/download/v1.0.0/pilosa-v1.0.0-darwin-amd64.tar.gz
74+
curl -L -O https://github.com/pilosa/pilosa/releases/download/v1.0.1/pilosa-v1.0.1-darwin-amd64.tar.gz
7575
```
7676
7777
Other releases can be downloaded from our Releases page on Github.
7878
7979
2. Extract the binary:
8080
```
81-
tar xfz pilosa-v1.0.0-darwin-amd64.tar.gz
81+
tar xfz pilosa-v1.0.1-darwin-amd64.tar.gz
8282
```
8383
8484
3. Move the binary into your PATH so you can run `pilosa` from any shell:
8585
```
86-
cp -i pilosa-v1.0.0-darwin-amd64/pilosa /usr/local/bin
86+
cp -i pilosa-v1.0.1-darwin-amd64/pilosa /usr/local/bin
8787
```
8888
8989
4. Make sure Pilosa is installed successfully:
@@ -100,7 +100,7 @@ There are four ways to install Pilosa on MacOS: Use [Homebrew](https://brew.sh/)
100100
backing up, and more. Complete documentation is available
101101
at https://www.pilosa.com/docs/.
102102
103-
Version: v1.0.0
103+
Version: v1.0.1
104104
Build Time: 2018-05-14T22:14:01+0000
105105
106106
Usage:
@@ -163,7 +163,7 @@ There are four ways to install Pilosa on MacOS: Use [Homebrew](https://brew.sh/)
163163
backing up, and more. Complete documentation is available
164164
at https://www.pilosa.com/docs/.
165165
166-
Version: v1.0.0
166+
Version: v1.0.1
167167
Build Time: 2018-05-14T22:14:01+0000
168168
169169
Usage:
@@ -222,19 +222,19 @@ There are three ways to install Pilosa on Linux: download the binary (recommende
222222
223223
1. To install the latest version of Pilosa, download the latest release:
224224
```
225-
curl -L -O https://github.com/pilosa/pilosa/releases/download/v1.0.0/pilosa-v1.0.0-linux-amd64.tar.gz
225+
curl -L -O https://github.com/pilosa/pilosa/releases/download/v1.0.1/pilosa-v1.0.1-linux-amd64.tar.gz
226226
```
227227
228228
Note: This assumes you are using an `amd64` compatible architecture. Other releases can be downloaded from our Releases page on Github.
229229
230230
2. Extract the binary:
231231
```
232-
tar xfz pilosa-v1.0.0-linux-amd64.tar.gz
232+
tar xfz pilosa-v1.0.1-linux-amd64.tar.gz
233233
```
234234
235235
3. Move the binary into your PATH so you can run `pilosa` from any shell:
236236
```
237-
cp -i pilosa-v1.0.0-linux-amd64/pilosa /usr/local/bin
237+
cp -i pilosa-v1.0.1-linux-amd64/pilosa /usr/local/bin
238238
```
239239
240240
4. Make sure Pilosa is installed successfully:
@@ -251,7 +251,7 @@ There are three ways to install Pilosa on Linux: download the binary (recommende
251251
backing up, and more. Complete documentation is available
252252
at https://www.pilosa.com/docs/.
253253
254-
Version: v1.0.0
254+
Version: v1.0.1
255255
Build Time: 2018-05-14T22:14:01+0000
256256
257257
Usage:
@@ -314,7 +314,7 @@ There are three ways to install Pilosa on Linux: download the binary (recommende
314314
backing up, and more. Complete documentation is available
315315
at https://www.pilosa.com/docs/.
316316
317-
Version: v1.0.0
317+
Version: v1.0.1
318318
Build Time: 2018-05-14T22:14:01+0000
319319
320320
Usage:

encoding/proto/proto.go

+2
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,7 @@ func encodeColumnAttrSets(a []*pilosa.ColumnAttrSet) []*internal.ColumnAttrSet {
961961
func encodeColumnAttrSet(set *pilosa.ColumnAttrSet) *internal.ColumnAttrSet {
962962
return &internal.ColumnAttrSet{
963963
ID: set.ID,
964+
Key: set.Key,
964965
Attrs: encodeAttrs(set.Attrs),
965966
}
966967
}
@@ -972,6 +973,7 @@ func encodeRow(r *pilosa.Row) *internal.Row {
972973

973974
return &internal.Row{
974975
Columns: r.Columns(),
976+
Keys: r.Keys,
975977
Attrs: encodeAttrs(r.Attrs),
976978
}
977979
}

executor_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ func TestExecutor_Time_Clear_Quantums(t *testing.T) {
12791279
expected []uint64
12801280
}{
12811281
{quantum: "Y", expected: []uint64{3, 4, 5, 6}},
1282-
{quantum: "M", expected: []uint64{3, 4, 6}},
1282+
{quantum: "M", expected: []uint64{3, 4, 5, 6}},
12831283
{quantum: "D", expected: []uint64{3, 4, 5, 6}},
12841284
{quantum: "H", expected: []uint64{3, 4, 5, 6, 7}},
12851285
{quantum: "YM", expected: []uint64{3, 4, 5, 6}},

gossip/gossip.go

+11
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ func (g *memberSet) Open() (err error) {
9393
return nil
9494
}
9595

96+
// Close attempts to gracefully leave the cluster, and finally calls shutdown
97+
// after (at most) a timeout period.
98+
func (g *memberSet) Close() error {
99+
leaveErr := g.memberlist.Leave(5 * time.Second)
100+
shutdownErr := g.memberlist.Shutdown()
101+
if leaveErr != nil || shutdownErr != nil {
102+
return fmt.Errorf("leaving: '%v', shutting down: '%v'", leaveErr, shutdownErr)
103+
}
104+
return nil
105+
}
106+
96107
// joinWithRetry wraps the standard memberlist Join function in a retry.
97108
func (g *memberSet) joinWithRetry(hosts []string) error {
98109
err := retry(60, 2*time.Second, func() error {

http/handler.go

+22-4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ type Handler struct {
5555

5656
ln net.Listener
5757

58+
closeTimeout time.Duration
59+
5860
server *http.Server
5961
}
6062

@@ -109,10 +111,20 @@ func OptHandlerListener(ln net.Listener) handlerOption {
109111
}
110112
}
111113

114+
// OptHandlerCloseTimeout controls how long to wait for the http Server to
115+
// shutdown cleanly before forcibly destroying it. Default is 30 seconds.
116+
func OptHandlerCloseTimeout(d time.Duration) handlerOption {
117+
return func(h *Handler) error {
118+
h.closeTimeout = d
119+
return nil
120+
}
121+
}
122+
112123
// NewHandler returns a new instance of Handler with a default logger.
113124
func NewHandler(opts ...handlerOption) (*Handler, error) {
114125
handler := &Handler{
115-
logger: pilosa.NopLogger,
126+
logger: pilosa.NopLogger,
127+
closeTimeout: time.Second * 30,
116128
}
117129
handler.Handler = newRouter(handler)
118130
handler.populateValidators()
@@ -146,10 +158,16 @@ func (h *Handler) Serve() error {
146158
return nil
147159
}
148160

161+
// Close tries to cleanly shutdown the HTTP server, and failing that, after a
162+
// timeout, calls Server.Close.
149163
func (h *Handler) Close() error {
150-
// TODO: timeout?
151-
err := h.server.Shutdown(context.Background())
152-
return errors.Wrap(err, "shutdown http server")
164+
deadlineCtx, cancelFunc := context.WithDeadline(context.Background(), time.Now().Add(h.closeTimeout))
165+
defer cancelFunc()
166+
err := h.server.Shutdown(deadlineCtx)
167+
if err != nil {
168+
err = h.server.Close()
169+
}
170+
return errors.Wrap(err, "shutdown/close http server")
153171
}
154172

155173
func (h *Handler) populateValidators() {

server.go

+17-6
Original file line numberDiff line numberDiff line change
@@ -369,17 +369,28 @@ func (s *Server) Close() error {
369369
close(s.closing)
370370
s.wg.Wait()
371371

372+
var errh error
373+
var errt error
374+
var errc error
372375
if s.cluster != nil {
373-
s.cluster.close()
376+
errc = s.cluster.close()
374377
}
375378
if s.holder != nil {
376-
s.holder.Close()
379+
errh = s.holder.Close()
377380
}
378381
if s.translateFile != nil {
379-
s.translateFile.Close()
380-
}
381-
382-
return nil
382+
errt = s.translateFile.Close()
383+
}
384+
// prefer to return holder error over translateFile error over cluster
385+
// error. This order is somewhat arbitrary. It would be better if we had
386+
// some way to combine all the errors, but probably not important enough to
387+
// warrant the extra complexity.
388+
if errh != nil {
389+
return errors.Wrap(errh, "closing holder")
390+
} else if errt != nil {
391+
return errors.Wrap(errt, "closing translateFile")
392+
}
393+
return errors.Wrap(errc, "closing cluster")
383394
}
384395

385396
// loadNodeID gets NodeID from disk, or creates a new value.

0 commit comments

Comments
 (0)