Commit graph

5736 commits

Author SHA1 Message Date
Kuba Podgórski
f0abb5e8b4
Merge branch 'master' into todo-503 2020-07-01 16:23:38 +02:00
Kuba Podgórski
e52b1c04fc
Merge pull request #512 from kuba--/todo-504
FieldValue - check if column arg exists
2020-07-01 16:06:16 +02:00
Kuba Podgórski
5bbb3e2065 FieldValue - check if column arg exists 2020-07-01 11:36:42 +02:00
Kuba Podgórski
58964947d4
Update executor_internal_test.go
Co-authored-by: Travis Turner <travis@pilosa.com>
2020-07-01 10:17:30 +02:00
Kuba Podgórski
f921c5ded0 Add test for Rows on bool 2020-07-01 01:30:36 +02:00
Jaden Weiss
ad2390444a
Merge pull request #500 from molecula/seebs-big-inspect-pr
Improve inspect output, switch roaring over to using new unmarshal, handle inspecting whole holders
2020-06-29 15:31:01 -04:00
Jaden Weiss
31014d11e5
remove unnecesary slice operation when processing holder 2020-06-29 15:22:27 -04:00
Seebs
4d494f6699
shared/generic functionality for iterating holders
This is sort of large, but it's annoyingly difficult to
separate out.

The basic idea is to allow us to have a single holder-iterating
block of code, which is associated with the holder, that can be used
for various things, like the snapshot queue background scan, or
for inspect operations.

We invent the concept of a HolderFilter, which is a thing that
can decide what things in a holder it cares about, and a HolderOperator,
which can also process those things selectively.

In the process, we fix up a couple of subtle bugs in the
inspect logic; specifically, the assumption that the mapped flag could
tell you whether a container was modified by the ops log doesn't
work with mmap, so we have a shiny new flag which is used to track
that, internal to the roaring/container code.

All of this leads to the actual *point* of this exercise, which is
making it easier to create an /inspect endpoint which produces almost
the same data we'd have gotten from `pilosa inspect` on a data directory;
the distinction is that it doesn't try to identify the distinction
between data from disk and data from operations since the file was
loaded. Possibly it should, but it doesn't yet.

The snapshot queue is now implemented using the HolderOperator
design, which requires some subtle changes to how it works, but
overall makes it easier to follow the snapshot queue logic,
and also shares that logic with the way Inspect works.

The holder's snapshot queue is now provided by the server, in
a default environment.

The queueless snapshot queue no longer triggers snapshots on
enqueue -- it turns out that breaks badly, because a key
point about enqueueing a snapshot is that it's safe to do it
*during* a transaction on that fragment, and triggering a
snapshot during a transaction actually causes horrible errors
as the ops log ends up being the old file, which we close.
Related to this, we also need to prevent closed fragments from
trying to snapshot, so we track fragment openness when opening
or closing, and bail on trying to snapshot a fragment which is closed.

We also stop using the queueless snapshot queue during tests,
because that's a horrible idea.

We copy a little bit of the partition logic from the cluster code so
we don't have to expose it all, this lets us check whether the node
we're looking at is the one which should be primary for a given shard,
and if not, identify which node would be. This works only when
pointed at a data directory, for now.

The test cases for the holder have to be internal, because pilosa
doesn't export view/fragment, just Index/Field. This means that the
holder test cases can't just use the test/* package, so they duplicate
some of its logic, approximately.
2020-06-29 15:18:47 -04:00
Seebs
2826ecc0b7
track retries correctly in truncation case 2020-06-29 15:13:51 -04:00
Seebs
176d49e4b5
use syswrap to close file after opening it with syswrap 2020-06-29 15:13:50 -04:00
Seebs
3e7f0b32e9
drop old Call data while processing a list of calls
We don't need the Calls anymore, and especially Precomputed calls
(like Distinct) could be a significant memory load that's increased
as we process additional calls, so we drop the Precomputed references.
We can't drop the calls entirely -- translation can require lookups of
call arguments.
2020-06-29 15:13:50 -04:00
Seebs
7e7051d387
don't try to truncate files when invoked read-only 2020-06-29 15:13:50 -04:00
Seebs
ceaf5c15d1
thread the holder through things, and improve snapshot queue logic
This is logically two separate things, but the individual changes
are thoroughly intertwined in the code.

The first change is a logical change to the design of the snapshot
queue, which is that it now adjusts the maxOpN the background scan
targets, allowing it to lower that value over time when things are
quiet. We do this because it turns out that on large data sets,
this can make a factor-of-four difference in memory usage!

So, in general, on a quiet system, each pass through the holder
aims for about 1/4 of the existing fragments to get snapshotted.
When there's more load, we adjust those values up.

We also make the snapshot queue a bit less chatty, to make testing
less annoying -- we only print stats if the queue enqueues at least
two snapshots, or skips any.

The second change is threading the holder through things. We've
always threaded the logger through, and then added the snapshot
queue, and some of the Inspect-related work led to wanting to
have a way to thread options through, so what if we just threaded
the holder itself through, and removed the direct copying around
of the logger, snapshot queue, and so on. Similarly, everything
can now use holder.PartitionN instead of having to get its own
copy of PartitionN handed out to each index.

This does imply ensuring that test cases always get a reasonable
default holder.

This is a precursor to adding additional information to the holder,
such as whether it's in a special read-only mode, which would imply
not modifying on-disk files. This is already semi-supported for
the specific case of the background snapshot queue and cache flushing,
which are attached to the (created in a previous commit) new
holder Activate method, instead of being automatic on holder Open.

The change to a snapshot queue can also cause races in tests, because
the fragment.Clean method's "sanity check" accesses a fragment without
a lock. Fix that. Since there's a couple of t.Fatalf(), but we need
to release the lock before closing, we use an anonymous function
with a defer to handle that. Whee!
2020-06-29 15:13:50 -04:00
Seebs
121717594b
improve inspect output, switch roaring over to using new unmarshal
At some point the code changeover to use roaring iterators for
unmarshal got dropped, but the old unmarshal code is way harder to
make work for inspect, so this change is back.

This exports some of the names from the things returned by Info,
but also adds a roaring function to use the unmarshalling logic on
arbitrary data, allowing us to get more insight into a file -- in
particular, letting us distinguish between the bitmaps specified by
the roaring data and the bitmaps resulting from applying the ops log.
2020-06-29 15:13:47 -04:00
Jaden Weiss
c1612851af
Merge pull request #498 from jaddr2line/transaction-test-timeout
TestTransactionManager: raise transaction timeouts to avoid sporadic failures
2020-06-29 14:42:21 -04:00
Jaden Weiss
0d05e413d3
TestTransactionManager: raise transaction timeouts to avoid sporadic failures 2020-06-29 13:44:20 -04:00
Jaden Weiss
a175858375
Merge pull request #496 from jaddr2line/molecula-rebrand
Rebrand pilosa binaries
2020-06-26 17:51:21 -04:00
Jaden Weiss
fedb1f7dbd
set version to match Molecula convention 2020-06-26 17:41:19 -04:00
Jaden Weiss
4a4252bb28
Merge pull request #1 from codysoyland/enterprise-removal
Remove a few more enterprise references
2020-06-26 17:24:02 -04:00
Cody Soyland
4f22c388b3 Remove a few more enterprise references 2020-06-26 15:57:21 -05:00
Jaden Weiss
cd317d7e91
tweak VERSION_ID 2020-06-26 16:49:06 -04:00
Jaden Weiss
aa1995073f
rebrand pilosa binaries
This change rebrands the Pilosa binaries from "Pilosa Enterprise" to "Molecula Pilosa" and simplifies the version info string.
2020-06-26 16:49:05 -04:00
Kuba Podgórski
8b33a073b4
Merge pull request #495 from kuba--/int-eq
Support '=' condition for int/decimal fields
2020-06-26 22:30:03 +02:00
Kuba Podgórski
4351464f84
Merge branch 'master' into int-eq 2020-06-26 21:26:44 +02:00
Jaden Weiss
a78b1cfe19
Merge pull request #446 from jaddr2line/fastrank
Remove allocations from ranked cache when possible
2020-06-26 12:46:58 -04:00
Kuba Podgórski
3782c3ac14 Support '=' condition for int/decimal fields 2020-06-26 18:14:59 +02:00
Jaden Weiss
94b55f8556
remove allocations from ranked cache when possible 2020-06-26 12:12:51 -04:00
Jaden Weiss
079bee5711
Merge pull request #489 from jaddr2line/field-cleanup
Remove unused field code
2020-06-26 11:37:15 -04:00
Jaden Weiss
5523587435
pilosa: remove unused field code 2020-06-26 10:14:56 -04:00
Jaden Weiss
0a030e9a77
Merge pull request #482 from jaddr2line/rm-invalid-unsafe
Remove invalid uses of unsafe from roaring containers
2020-06-25 15:02:33 -04:00
Jaden Weiss
934048bb02
roaring: remove invalid uses of unsafe 2020-06-25 11:48:21 -04:00
Kuba Podgórski
47481432ef
Merge pull request #468 from kuba--/fix-DEGRADED
Lets the remote node to proceed
2020-06-25 17:05:30 +02:00
Kuba Podgórski
80cfb5c182
Merge branch 'master' into fix-DEGRADED 2020-06-25 16:41:41 +02:00
Kuba Podgórski
0bdb420b4c
Merge pull request #475 from kuba--/fix-iface-conv
Make a safe cast
2020-06-25 15:36:53 +02:00
Kuba Podgórski
ed86f6ea5d Make a safe cast 2020-06-25 14:44:14 +02:00
Cody Soyland
bc9d13206f
Merge pull request #490 from codysoyland/ci-fixes
Fix/refactor CircleCI config
2020-06-24 13:52:45 -05:00
Cody Soyland
2024228153 Fix/refactor CircleCI config
- Fix incorrect usage of workspaces (vendor dir in current directory no
  longer primary cache of go modules)
- Refactor checkout, github-auth, and mod cache into a reusable command
- Fix issue with dockerhub upload and github authentication
2020-06-24 13:45:17 -05:00
Kuba Podgórski
413ce4f1ab
Merge branch 'master' into fix-DEGRADED 2020-06-24 19:56:24 +02:00
Jaden Weiss
2925101b09
Merge pull request #487 from jaddr2line/cluster-message-error
Differentiate between cluster message request errors and cluster message processing errors
2020-06-24 09:44:03 -04:00
Jaden Weiss
b5b60b8912
http: differentiate between cluster message request errors and cluster message processing errors 2020-06-24 09:23:08 -04:00
Jaden Weiss
89ac3f4737
Merge pull request #486 from jaddr2line/handlerfixes
Fix incorrect error handling in HTTP handler and output raw error text when JSON is not selected
2020-06-23 12:57:55 -04:00
Jaden Weiss
66aef92cfa
http: fix incorrect error handling and output raw error text when JSON is not selected 2020-06-23 12:26:37 -04:00
Cody Soyland
16ebdf290d
Merge pull request #479 from codysoyland/ci-dockerhub-fix
Fix and simplify CI DockerHub integration
2020-06-23 09:13:41 -05:00
Cody Soyland
7cb9548097 Fix and simplify CI DockerHub integration 2020-06-19 11:41:54 -05:00
Jaden Weiss
5dc02a3998
Merge pull request #474 from jaddr2line/timeclr
Fix Clear() returning `false` when it should return `true`
2020-06-19 09:03:42 -04:00
Jaden Weiss
a270bff67b
fix Clear() returning false when clearing a bit with no time views 2020-06-19 08:51:08 -04:00
Kuba Podgórski
739935c3f6
Merge branch 'master' into fix-DEGRADED 2020-06-18 16:13:58 +02:00
tgruben
21888703e5
Merge pull request #469 from tgruben/splat-init
Functionalize  fillerBitmap initialization
2020-06-17 09:39:16 -05:00
tgruben
3103da2c19
Update roaring/container_stash.go
Co-authored-by: Jaden Weiss <jaden@jadendw.dev>
2020-06-17 08:51:25 -05:00
Todd Gruben
f47888989a shorten fillerBitmap initialization 2020-06-17 07:12:24 -05:00