Commit graph

558 commits

Author SHA1 Message Date
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
tgruben
751b7a74fe staticcheck fixes (#2278)
(cherry picked from commit 0aa5efcc51)
2022-11-15 11:33:10 -08:00
Seebs
7d1fde7438 drop anti-entropy feature, since it doesn't work
The anti-entropy feature has never actually worked. We've been
talking about removing it or replacing it for ages, but haven't
had a concrete motivation.

But the anti-entropy interface is the sole user of several components
of the Tx interface, and now that we're trying to replace that
interface, being able to drop those components has some appeal, so
let's remove the one thing that used them, in the hopes that this
will simplify life.

This also lets us drop ForEach and ForEachRange, which were
barely used at all. The one surviving usage (CSV export) can be
handled by using the container iterator we already have, and
making ContainerCallback exported so we can use it to just call
things for every bit.

(cherry picked from commit fff9ddc1f5)
2022-11-15 11:31:13 -08:00
Seebs
20b018c0b2 remove a commented-out test case for a function that no longer exists 2022-09-30 11:25:27 -07:00
CLoZengineer
f9ddb5d5c1
fix: updating code to meet linting requirements (#2171)
* removes unused filesize function

* removes ioutil usage

* updates ioutil.ReadAll to io.ReadAll

* updates ioutil.TempFile to os.CreateTemp

* updates ioutil.TempDir to os.MkdirTemp

* updates ioutil.ReadAll to os.ReadAll

* update ioutil.WriteFile to os.WriteFile

* updates ioutil.Discard to io.Discard

* updates ioutil.ReadDir to os.ReadDir where applicable

* removes unused code in idk

* creates type to use for context value keys

* replaces assert.Nil with assert.NoError for error checks
2022-09-29 12:34:29 -04: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
Kuba Podgórski
730fab38dc Add unionRunRunInPlace 2020-07-14 15:10:26 +02:00
Seebs
827923e616 Handle file sizes over 4GB
We only have 4 bytes for offsets, but what if a file is
over 4GB? Someone came to us with a file with 265 *million* containers,
in a single fragment, which means that over 3GB of their 4.7GB file
is actually just the container headers alone. But we can't easily make
the offsets larger, or change the file format.

So we don't. We just track how many 4GB hunks of the file we've
been through and bump that every time the 32-bit offset wraps. And this
appears to... just work.

This is fixed for both the roaring iterator and the old unmarshalBinary
logic. The logic to handle this will work on 32-bit hosts in the sense
that it will correctly error out for excessively large file sizes or
container counts, but it doesn't actually handle the large files since
it can't.
2020-04-24 10:56:24 -05:00
Pierre Fersing
e8ca41e522 Fix runCountRange when range start == interval start
When the interval is a proper superset of the range with start equal to
interval start, the range must be considered a superset or it will be
completly ignored (since it neither a subset nor it overlaps)
2020-03-13 10:47:39 +01:00
Seebs
ef40a5a219 double the nolint comments, double the checking 2019-10-11 15:17:51 -05:00
Ben Johnson
c7c9c1e1d7
v2.0.0
Co-authored-by: Cody Soyland <codysoyland@gmail.com>
2019-10-08 14:56:17 -06:00
Cody Soyland
8e208569e8 Remove build tag that break enterprise build 2019-09-17 13:34:28 -05:00
Matt Jaffee
b84eada521
rename file and add license header 2019-08-07 08:09:04 -05:00
Matt Jaffee
fba496bc91
generalize test strings and break out old UnmarshalBinary code
(don't use iterator for unmarshalBinary)
2019-08-05 17:39:47 -05:00
Seebs
1d732e4b7f drop unused functions from previous unmarshal implementation 2019-07-25 16:11:57 -05:00
Seebs
b04037900c move to using roaring iterators for UnmarshalBinary
The new roaring iterator used for the remap and importroaring
things could also be used for unmarshalling roaring streams,
and it's a slightly simpler design that doesn't need two passes
through the data. This patch cleans that up a bit, makes it work
better with ops logs, and uses that instead. It appears to
noticably but not immensely reduce the time imports take, but it
also gets us back down to one thing parsing roaring formats.

There are a couple of subtle changes to errors we were testing
for in various tests, and one of the fuzz tests goes away because
it was actually itself an erroneous error message -- it was reporting
the header of a roaring file as an invalid op because the op log
reader was running on the header for roaring files with zero
containers. Oops.
2019-07-25 16:03:18 -05:00
Seebs
e1fbed51b2
use symbolic names for op types, add checks for invalid types 2019-07-01 13:16:03 -05:00
Seebs
17eb13702e
address lint concerns
Addressing various lint.

incrementOpN no longer returns errors, because it no longer waits for
the snapshot, so checking those errors is unnecessary.

Several fields in a common embedded structure were "unused" according
to a naive checker.

Other tiny style things, and one actual unchecked error. Yay linters!
2019-07-01 13:16:02 -05:00
Seebs
cb50a5a48b
revert BSIv2 change impact on Official Roaring
The Pilosa roaring format uses two bytes of its
header, next to the magic number, for a version. The
official roaring format uses them for a container
count, if and only if it's the version of the format
that uses run-length containers.

But if it is, it really does need those bits. Also,
since we never use the official format in our internals
or snapshots, we don't have any reason to support
reading flag bits in it, since the flag bits are used
only for internals of fragments and snapshots. So
we revert the change to support flags with official
roaring bitmaps.

A couple of the fuzz tests happened to rely on this,
and we may find more issues with more fuzzing.
2019-07-01 13:16:02 -05:00
Seebs
67830b74cf
allow importRoaring to work with official format roaring
I didn't think of this, because we don't use it much in the
client. This is a bit hairy because really official roaring
is two fairly different formats, one with runs and one without.
2019-07-01 13:16:02 -05:00
Seebs
4b657c1962
use a queue for snapshot operations
As the size of a fragment grows, the cost of snapshots
increases; with a large fragment getting a lot of large writes,
every write will trigger a snapshot, while any other writes have
to wait for that snapshot before they, too, can trigger a snapshot.

To address this, we introduce a background queue of snapshots.
In general, operations which were omitting their ops log writes
and just snapshotting no longer do; they emit an ops log. This does
mean that, in some cases, the ops log is written and then a snapshot
takes place essentially immediately, which costs us some performance.
However, that only actually happens under very light load; under
heavier load, there's generally going to be multiple writes coalesced
into each snapshot, and the ops log writes for them will be much
cheaper than a full snapshot.
2019-07-01 13:16:02 -05:00
Seebs
b369dace69
remap storage on reopen, instead of remarshalling it
When we do a snapshot, we may end up with containers which are
mmapped to the old file, and containers which have allocated storage
identical to the contents of the new file. It would be nicer if they
were mapped to it. But unmarshalling the entire file is expensive.

Instead, we remap it. (Or, if we couldn't mmap it, just make sure
the old stuff is no longer using the old storage space before we
munmap it.)
2019-07-01 13:16:02 -05:00
Seebs
7f1763e466
address fuzz testing for new op types
The new op type code changed the failure mode for
one of the fuzz test issues -- and the fuzz test revealed a
bug in the code. Fixed the code, updated the test to expect
the newer, better, message.

Also fixed capitalization on the old message.
2019-07-01 13:16:01 -05:00
Seebs
c19b7af0d0
Support direct roaring import operations
We add a new ops log type(pair), AddRoaring and RemoveRoaring,
which set and clear the bits from a provided roaring bitmap.

This also compels us to consider additional sanity checking
during tests.
2019-07-01 13:16:01 -05:00
asvetlik
f54bb5ed2b
Merge branch 'master' into tests 2019-06-26 10:07:20 -05:00
asvetlik
91387ba601
Merge branch 'master' into tests 2019-06-26 09:31:37 -05:00
shaqque
368bb46f45 switched naive_test.go to table driven tests 2019-06-25 17:25:07 -05:00
shaqque
7ba9e18a51 Merge branch 'master' of https://github.com/pilosa/pilosa into fuzz-roaring 2019-06-25 11:22:47 -05:00
shaqque
bc0f86755a added roaringsentinel build tag to check for user errors at build time 2019-06-25 11:16:34 -05:00
shaqque
4f8b3f650e added go-fuzz testing for roaring ops vs naive implementation 2019-06-25 10:47:53 -05:00
asvetlik
fb841c3327
Merge branch 'master' into master 2019-06-25 08:10:40 -05:00
Shaquille Wyan Que
46121da00a
Merge branch 'master' into 2015RoaringBugs 2019-06-24 21:33:57 -05:00
shaqque
86e703637b fixed seeking end of run container iteration bug when next container exists and ensure roaringparanoia panics before other ops 2019-06-24 15:18:03 -05:00
Ashley Svetlik
55aa864cac Fixed malformed offset bug in readOffsets 2019-06-24 12:55:32 -05:00
Ashley Svetlik
eb5d1ae1a4 Fixed malformed offset bug in readWithRuns 2019-06-24 12:51:10 -05:00
asvetlik
464cc1d4ed
Merge branch 'master' into tests 2019-06-24 12:31:14 -05:00
Ashley Svetlik
b0165d7ef9 Revised WithErrors test with err corrections 2019-06-24 12:22:51 -05:00
Ashley Svetlik
6b6249b86a Merge branch 'tests' of https://github.com/asvetlik/pilosa into tests 2019-06-24 12:13:06 -05:00
Ashley Svetlik
7ff26194d8 Corrected err and checked for err 2019-06-24 12:11:44 -05:00
asvetlik
250a3f6fbb
Merge branch 'master' into tests 2019-06-24 09:02:52 -05:00
Ashley Svetlik
8fd23239a1 Formatted Fuzz_test.go 2019-06-21 10:09:20 -05:00
Shaquille Wyan Que
a6ba7e339c fix container iteration bugs in roaring 2019-06-20 20:50:58 -05:00
Ashley Svetlik
031e23cdea Resolved int overflow 2019-06-20 15:02:18 -05:00
Ashley Svetlik
157e910103 Fuzz_test changes 2019-06-20 14:49:04 -05:00
Ashley Svetlik
873486bc1a Removed no containers pilosa format fix 2019-06-20 14:43:55 -05:00
Ashley Svetlik
18d86a204c Revised test for pilosa roaring no containers 2019-06-20 14:36:38 -05:00
Ashley Svetlik
6943b3c5ba Returned files to original version 2019-06-20 14:35:35 -05:00
asvetlik
f772ca4a34
Merge branch 'master' into master 2019-06-19 14:48:48 -05:00
Ashley Svetlik
ea4950781a Changed roaringData/roaringFileName and made tests work 2019-06-19 14:09:06 -05:00