Commit graph

71 commits

Author SHA1 Message Date
Fletcher Haynes
a479441ea2 Reverted some testing log messages and commented out code 2023-03-01 21:43:53 -08:00
Fletcher Haynes
21bc76ddb2 Removed cobra option to ignore parse errors of flags since we are using MarkDeprecated 2023-03-01 21:43:53 -08:00
Fletcher Haynes
660428d5fb This changes the server sub-command to ignore unknown flag. Fixes FB-2019 2023-03-01 21:43:53 -08:00
Matthew Jaffee
b43c4aabc5
move DD profiling/tracing setup into command where it belongs (#2233)
* move DD profiling/tracing setup into command where it belongs

* add url to http trace, use golang for container image
2023-02-01 16:20:39 -06:00
Matthew Jaffee
6d4c1d9db1
Sup 294 pre sort command (#2209)
* first cut at pre-sort command that works on ndjson

* finish pre_sort command for CSV and JSON and add test

* try fixing golangci-lint

* remove some dumb lint checks

* more linter disabling

* take .golangci.yml from previous repo

* go fmt (facepalm)

* remove ioutil to fix lint
2023-01-23 12:26:38 -06:00
Joe Friedrich
48178064fe sync cherry-picks 4750c2215..17cb2cbb7 2023-01-12 00:59:13 +00:00
Julio Martinez
c23608557b Add dd tracer and associated config options (#2403)
Co-authored-by: Julio <julio.martinez@featurebase.com>
(cherry picked from commit 581a4d19a4)
2023-01-12 00:49:58 +00:00
Lory Cloutier
b6ae088f24 FB-1766: cleaning up the CmdIO objects passing alternate stdin/
stdout/stderr around

A lot of functions in the cmd and ctl packages were passing these
around and barely using them. Replaced them with a logger for most
functions. Some functions get an io.Writer instead so that their
tests can find the output they're looking for.

More cleanup on fb-1766: reworked the tests that were using io.Pipe
or os.Pipe to check their results so they now use a bytes.Buffer.

Unexported some variables that didn't need to be exported.
Fixed NewConfigCommand to use the provided stderr, not os.Stderr.
Added tests for rbf_dump, rbf_page, and keygen, since those weren't
being tested at all.

Added chksum_test, final cleanup.

(cherry picked from commit f627199acb)
2022-12-12 09:01:20 -08:00
Seebs
3c05f1ff37 Distinguish between usage errors and other errors
Cobra automatically displays usage messages, and also a gratuitous
"Error: [...]" line in some cases, when any error at all occurs
running a command. To suppress the usage message, you have to set
cmd.SilenceUsage to true. But the code that would do this doesn't
have access to it. To address this, we introduce a category of
"usage error", implemented with stdlib error wrapping (%w) and
use errors.Is to check for it. There's also utility functions
to do this checking automatically, or indeed, to handle wrapping
of the ctl.SomethingCommand and handle running it with a suitable
context and everything.

In fact, several of the places we're checking for usage errors,
we can never actually report one, but we're checking consistently
so that if we want to report usage errors, we can.

For instance, server.Start and (dax)server.Start don't ever
return usage errors, right now, but we're checking their responses
anyway.

(cherry picked from commit c681642734)
2022-12-12 09:01:20 -08:00
Fletcher Haynes
da9b57bd45 Updated dependency paths to reflect new repo location 2022-09-06 09:39:22 -07:00
Fletcher Haynes
eb06bb50ae Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
Ben Johnson
c7c9c1e1d7
v2.0.0
Co-authored-by: Cody Soyland <codysoyland@gmail.com>
2019-10-08 14:56:17 -06:00
Seebs
29a1db4550 add "holder" command to start up and shut down
It would be neat to be able to observe performance of
"just open the holder". So let's make that a verb.
2019-07-25 15:38:38 -05:00
Matt Jaffee
efd424ebab
add ability to disable tracing and use nopTracer
Have found some potential performance or stability issues associated
with lots of mutex blocking in getting a parent span's context. Want
the ability to totally disable tracing to help debugging.
2019-07-03 11:02:59 -05:00
Ben Johnson
8e49332b25 Add distributed tracing. 2018-11-21 15:08:33 -06:00
Cody Soyland
0b86bbb4f5 Fix linter issues: gochecknoinits 2018-07-18 11:58:27 -05:00
Cody Soyland
73a7588e1b Unexport cmd.NewServeCmd 2018-07-05 23:11:56 -05:00
Matthew Jaffee
f99479932d
rename server Run to Start to better reflect functionality 2018-04-23 16:28:24 -05:00
Matthew Jaffee
28acc29a10
refactoring pilosa/server
trying to separate internal an external concerns in pilosa.Server - it should
handle Cluster, Holder, etc. while pilosa/server handles things with external
deps - e.g. Logger, Stats, Handler, etc. Using functional options in
pilosa.Server now.
2018-04-23 13:35:39 -05:00
Travis Turner
36ce12da59
This commit adds a Close() method to the pilosa.Logger interface,
and it moves the file handling (open/close) out of the main Command and
into the interface implementation. The Logger implementations both have
a `Logger()` method which returns their internal logger (`*log.Logger`).
This is because the gossip setup (memberlist) needs a `*log.Logger` for
its configuration.
2018-03-27 08:40:05 -05:00
Travis Turner
9a2aeac6f8
Clean up logger; make it honor --log-path flag.
Add functional options to NewGossipMemberSet.
2018-03-27 08:40:04 -05:00
Yuce Tekol
79cea495d7
Handles SIGTERM signal; resolves #827 2017-09-14 11:17:28 +03:00
Alan Bernstein
b9e853dbdb Deduplicate logfile opening code 2017-06-23 18:08:30 -05:00
Alan Bernstein
12e6b22abe WIP replace fmt prints with logger prints and Stderr with LogOutput 2017-06-23 17:27:57 -05:00
Michael Baird
f822bb43e9 Remove long query time from Server. That parameter is managed in the Cluster. 2017-05-30 12:55:45 -05:00
Michael Baird
57da86dd8e cleanup merge conflict 2017-05-23 10:33:35 -05:00
Michael Baird
b0f8d5d8f9 Merge remote-tracking branch 'origin/master' into metrics
Conflicts:
	cmd/server.go
	ctl/config.go
2017-05-23 10:07:44 -05:00
Ben Johnson
788386b49a
Implement 'config' CLI command.
Renames `config` to `generate-config` and implements a new `config`
command that generates the configuration file based on the current
state instead of printing a static string.
2017-05-22 09:30:14 -06:00
Michael Baird
bd44949cb5 Merge remote-tracking branch 'origin/master' into metrics
Conflicts:
	config.go
	executor_test.go
	server/server.go
2017-05-09 11:31:14 -05:00
Michael Baird
bf6ed942f0 Merge pull request #8 from alanbernstein/stats
Stats
2017-05-09 11:15:23 -05:00
Ben Johnson
e3d6f96657
Add max-writes-per-requests limit.
A configurable limit has been added to restrict the number of
mutating calls in a `pql.Query`. This is to prevents requests from
timing out from large queries.

The default is set to 5000 writes per request and is configurable
through the configuration file and the command line flags.
2017-05-03 08:53:20 -06:00
Michael Baird
ee159b455d Merge remote-tracking branch 'origin/master' into metrics
Conflicts:
	.gitignore
	cluster.go
	frame.go
	glide.lock
	index.go
2017-05-01 10:41:04 -05:00
Cody Soyland
3996b56b88 Apply Apache License 2.0 2017-04-28 14:22:03 -05:00
Michael Baird
e699c55700 fixed conflicts from the db index change
Conflicts:
	cluster.go
	executor_test.go
	handler_test.go
	server.go
2017-04-25 11:47:29 -05:00
Michael Baird
a543ba21bb fixed DB to index conflicts after merge 2017-04-24 21:59:39 -05:00
Alan Bernstein
9bf6e1b3b7 Move LongQueryTime option to cluster section of config file 2017-04-24 15:22:12 -05:00
Alan Bernstein
6a162c4be2 Support LongQueryTime as config option 2017-04-21 18:50:25 -05:00
Alan Bernstein
83e13bec74 Move version vars to pilosa package 2017-04-21 10:14:21 -05:00
Michael Baird
6f1e3c9275 add stats metric options to config 2017-04-19 16:51:55 -05:00
Travis
4c8e46e17f change Config.Nodes to Config.Hosts 2017-04-19 10:37:00 -05:00
Travis
b4a69be751 Add support for Node.InternalHost.
This was required for the HTTPBroadcaster to run locally on different InternalPorts.
2017-04-19 10:37:00 -05:00
Matt Jaffee
d10d8d94e1 simplify config structure - remove gossip sub-struct 2017-04-19 10:36:28 -05:00
Matt Jaffee
0da580d0e9 change broadcaster-type to type
It is nested under "cluster" in the config, and it controls cluster membership
as well as broadcasting, so I think type is more appropriate. Also, brevity.
2017-04-19 10:36:28 -05:00
Matt Jaffee
32d07fc9e1 rename MessageBroker -> Broadcaster 2017-04-19 10:34:52 -05:00
Travis
b0f1fc7523 Makes Messenger a first-class object under Server (with pointers in Handler and Index).
Primary message interface is the MessageBroker which is an attribute of the Messenger.
MessageBroker implementations:
- Gossip (memberlist)
- Broadcast (uses HTTP, received by existing Handler)
- Static (no-ops)

Changes CacheSize from `int` to `uint32` for consistency with protobuf.
Removes unnecessary dependencies in glide:
- `github.com/aws/aws-sdk-go`
- `golang.org/x/net` (although this gets included by memberlist)

TODO:
- [ ] Add tests around the Messenger and MessageBroker objects.
- [ ] Refactor CreateSliceMessage to work with views.
- [ ] Support propogation of meta data on PATCH calls.

fixing some issues from last rebase
2017-04-19 10:33:26 -05:00
Travis
74b81eeac1 adjustments to support the new Config structure 2017-04-19 10:21:19 -05:00
Matt Jaffee
e6309d45e1 make sure exported functions are godoc'd 2017-04-18 15:10:59 -05:00
Yuce Tekol
5353448a92 Adds log-path config 2017-04-05 16:09:43 +03:00
Matt Jaffee
176861d702 add embedded struct to contain io for commands
per @tgruben's suggestion
2017-03-17 16:43:04 -05:00
Matt Jaffee
5f267c0a3a support the various ways of specifying bind addr 2017-03-17 16:43:04 -05:00