Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Decimal mutex import breakout use row instead of range #260

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

jaffee
Copy link
Member

@jaffee jaffee commented Nov 13, 2019

a totally reasonable set of changes that is perfectly described by the branch name

plus the import clearing stuff.

jaffee and others added 13 commits December 13, 2019 10:10
go-pilosa can now create decimal type fields — this functionality is
currently only available in Molecula's Pilosa fork.

expose import code so that the batch importer can use it to import to
mutex fields. Allow mutex fields in the batch importer.

For some reason go-pilosa was still generating deprecated "Range"
queries instead of "Row", so put a stop to that.
This was causing the same shard to be used by import requests which
were supposed to use different shards. A very sinister bug.
There was a deadlock which @tgruben found in detectClusterChanges
where it could acquire a lock and never release it if there were no
indexes or shards.

TranslateKeys requests fail if the slice of keys is empty. We now test
for this condition and return an empty slice of uint64 without hitting
Pilosa.

In importbatch, if a nil is encountered and the field is not an
integer or decimal field, there is no way of knowing if this value
will be using []string normally, or string or uint64. Instead of
unconditionally appending to rowIDs, we wait until we know which value
type this will be (as soon as we receive a non-nil value). Then we
nil-extend rowIDs for this field if necessary.

We now support []uint64 in addition to []string in importbatch — this
is analagous to supporting strings and uint64, and they can be
intermixed in the same value field.

Also changed the way that indexes and fields are encoded to strings
because a test was breaking due to the addition of a mutex to the
Index. I don't think this affects much of anything.
a lot of this logging should probably be tracing

the toTranslateID change became necessary because although IDs were
coming in roughly sorted, they were getting randomized by the
map. This was fine until the translated IDs crossed a slice boundary,
and then 1000s of requests were being generated for a single batch as
the value importer flipped back and forth between slices.

the bug fix is explained in a comment, but basically makeFragments
iterated over b.rowIDs and assumed that anything in clearRowIDs would
also be in rowIDs. In this particular case, nothing had yet been added
to rowIDs, so the clear was skipped.
@jaffee jaffee force-pushed the decimal-mutex-import-breakout-use-row-instead-of-range branch from b250342 to 7e2a544 Compare December 13, 2019 16:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants