Commit Graph

178 Commits

Author SHA1 Message Date
Ben Kalman e50f773ec6 Use a non-nil ValueReader in sequenceChunker.Done (#2273)
Fixes https://github.com/attic-labs/noms/issues/2220.
2016-08-05 14:22:39 -07:00
Erik Arvidsson 35955c06d9 JS: Fix encoding bugs related to signed varints (#2267)
The library that we were using multiplied (and divided) by 2 to
do the zigzag encoding. However, if we are already close to the
precision limit then we lose precision and the encoding/decoding
does not round trip.

Instead, we split the float64 into two Uint32 numbers and do the
operations on those.

Also, the code that split a float64 into base and exp was not shifting
enough, it was shifting until float64(maxInt64) when we need to shift
until less than max safe int (according to float64)

Fixes #2104
Fixes #2234
2016-08-05 11:45:29 -07:00
Ben Kalman c386725d4e Fix struct diff (#2281)
It inverted the added/removed order.
Fixes https://github.com/attic-labs/noms/issues/2278.
2016-08-04 16:11:11 -07:00
cmasone-attic b89aa7dda0 Merge pull request #2261 from cmasone-attic/dataset_cleanup
Dataset cleanup
2016-08-04 10:05:31 -07:00
Chris Masone 26211aadd5 Comment fix: RefCommit -> Ref<Commit> 2016-08-04 09:37:48 -07:00
cmasone-attic 4ccaa7014a Rate-limit LevelDBStore read operations as well (#2239)
Under load, our server can exhaust the number of file descriptors it's
allowed to have open at one time. Part of this is because of how many
incoming connections it's handling, but we believe that handling lots
of simultaneous reads to leveldb is the larger part of the issue.

This patch applies the rate limit we were using for writing to both
read and write operations.

Fixes #2227
2016-08-04 09:35:35 -07:00
Chris Masone 0f910239d8 Dataset cleanup
1) ValueStore now maintains validation cache info across Commit() calls,
   so we can remove a workaround in Dataset.Commit()
2) Update comment for setNewHead
2016-08-03 13:06:11 -07:00
Ben Kalman 7c10334472 Make sure that set/map diff has completed before returning from noms log (#2249)
This fixes https://github.com/attic-labs/noms/issues/2235 where set/map
diff was still running when noms log has finished, and already closed
its database. Commonly this would crash.

I've removed panic-based control flow to make error handling explicit,
and added a "DiffLeftRight" method to set/map so that noms log completes
ASAP. See the issue for details.
2016-08-02 18:14:09 -07:00
Ben Kalman 07be381117 Support reading from stdin in url-fetch
I need this in the short term because CSV raw files are too large to
check into github, so they need to be split up. It's easier to just do
"cat * | url-fetch -stdin" than recombining them on the file system.
2016-08-02 17:29:10 -07:00
Adam Leventhal 117eafebbc add Blob.Splice() (#2242) 2016-08-02 16:58:41 -07:00
mgedigian 321350d7e5 fixing typos, stale comments, broken link (#2250) 2016-08-02 15:47:04 -07:00
Adam Leventhal 6f46c0eba3 clean up human readable output (#2244) 2016-08-02 13:31:19 -07:00
Chris Masone 7da80c971e Fix some comments in remote_database_handlers.go 2016-08-02 11:44:29 -07:00
Chris Masone 4f073aee3d Validate type of new Root in root/ POST handler
In the server side of the Remote Databse, the handler for
UpdateRoot now verifies that the new proposed Root is of a
legal type: empty map OR Map<String, Ref<Commit-like>>

Fixes #2116
2016-08-01 16:05:37 -07:00
Dan Willhite 8fee5ca80b Merge pull request #2225 from willhite/work
Increase performance of walk.AllP() for large collections.
2016-08-01 12:00:01 -07:00
cmasone-attic 55025ee801 Add caching layer to demo-server (#2228)
This patch creates a new kind of chunks.Factory that demo-server
uses to vend ChunkStore instances that all share the same
MemoryStore-based Chunk cache. This cache _will_ grow without bound,
but the current RAM/data ratio on demo.noms.io means that, in practice,
we will be fine for a bit.

This will need to be removed in favor of a real solution in Issue #2227

Fixes #2009
2016-08-01 11:55:16 -07:00
Dan Willhite e87cbb7574 Increase performance of walk.AllP() for large collections.
Call IterAll() on collections rather than ChildValues().
2016-08-01 11:44:38 -07:00
Rafael Weinstein 1c1d1920bf Make Pull step down one level at a time, de-dup source DB work queue (#2226)
It turns out Pull() was making some bad assumptions about how the Go
heap package used its backing storage. Since it wasn't really relying
on heap guarantees anyway, this changes the code to use a slice of Ref
that's sorted in order of increasing ref-height: RefByHeight.
2016-08-01 11:28:29 -07:00
Mike Gray 93916c5139 exposing StructData, updating tour (#2214) 2016-08-01 12:09:02 -04:00
Adam Leventhal 754ed1b6dd ValueDecoder.readUnion() can use getCompoundType() rather than makeUnion() (#2210)
Clean up the tests that led us here
2016-07-30 11:21:04 -07:00
Adam Leventhal e920c12c1c Fix cyclic type nondeterminism (#2147) (#2148) 2016-07-29 21:35:17 -07:00
Erik Arvidsson ed0364cc19 Switch to gnuflag (#2206)
This is to support:
- shorthands
- Putting commands anywhere (after positional arguments too)
2016-07-29 18:08:23 -07:00
Ben Kalman 7460dc4d99 Wait for less to start before returning from outputpager.Start() (#2209) 2016-07-29 18:03:48 -07:00
Rafael Weinstein 3d86ddb33a Fix IndexedSequenceDiff bug when entire subtree is added / removed (#2197)
IndexedSequenceDiff special cases the situation when an entire subtree was added or removed, but got its math wrong.
2016-07-29 13:22:39 -07:00
cmasone-attic 593a649296 Merge pull request #2189 from cmasone-attic/issue2169
Remove NewSerializer
2016-07-29 08:00:52 -07:00
Ben Kalman b2096234fd Make the output pager close the pipes it creates (#2187)
This makes less exit properly - before, it wasn't properly restoring the
terminal sometimes, and keyboard input stopped working.
Fixes https://github.com/attic-labs/noms/issues/2180.
2016-07-28 17:55:18 -07:00
Erik Arvidsson ff88ff2a65 Commit type: Compute the type for meta too (#2185)
This changes to compute the type for the meta field in a similar
way to how we compute the type for the value field.

Fixes #2179
2016-07-28 17:14:35 -07:00
Erik Arvidsson a995d5dafc Disallow nil in Value Equals (#2156)
We do not allow nil in any other places as a Vale so there is
little reason to allow it Equals

Fixes #2155
2016-07-28 16:58:33 -07:00
Rafael Weinstein 74ba1012c2 sequence.getOffset => sequence.cumulativeNumLeaves (#2193)
sequence.getOffset was problematic and didn't have a clear meaning. In addition it was causing a bunch of +1 code at call sites. This patch replaces it with cumulativeNumLeaves which has a clearer meaning.
2016-07-28 16:55:41 -07:00
Rafael Weinstein 1dc71c7f27 Align JS & Go impl of binary search (#2192) 2016-07-28 16:44:49 -07:00
Chris Masone b0112ba52b Remove NewSerializer
NewSerializer spun up a goroutine within itself. We've decided
this is an anti-pattern. Furthermore, we were using this inside
our remote database handler code, and a panic inside that goroutine
could take down the server. The callsites now use Serialize() directly.

Fixes #2169
2016-07-28 16:05:03 -07:00
Erik Arvidsson b20bec9b23 noms diff --summarize (#2183)
Shows number of changes between two top level values.

```
noms diff -summarize $l::#t5p4im6uug7n5m72frr0dnjnkm04e4ph.value $l::#ueo0utduuqsf9vrntrhn25lnc19m848l.value
```

Prints:

```
13,636 insertions, 0 deletions, 107 changes, (1,919,894 values vs 1,933,530 values)
```

Where the numbers are updated as more data is computed from the diff.

Towards #2031
2016-07-28 15:01:27 -07:00
Ben Kalman c1472fdd03 Make sure top-down and left-right diff finish before returning from best (#2184)
Leaving them running will cause a few database reads after
orderedSequenceDiffBest returns, and it looks like this is causing a
deadlock (see https://github.com/attic-labs/noms/issues/2165). I've also
seen a log related crash which goes away after this patch.
2016-07-28 14:57:31 -07:00
Ben Kalman deab7606b2 Fix empty sequence in getCompositeChildSequence (#2167)
Based on a patch by mike@mikegray.org
2016-07-27 17:12:35 -07:00
Erik Arvidsson b0e77c250c Cleanup Struct Diff (#2160)
- Too have same API as all the other diff methods
- Send changes to channel without intermediary slices and without the
need to union and sort the fields
2016-07-27 14:56:22 -07:00
Chris Masone afb50a6272 Add comment explaining DynamoDB table format to dynamo_store.go
Fixes #2170
2016-07-27 12:37:13 -07:00
Erik Arvidsson 7a4436e9b5 Remove Type name property (#2161)
Only struct types have a name property and this was left over from
an earlier refactoring.
2016-07-26 15:31:43 -07:00
Ben Kalman b7653d3875 Fix 2 deadlocks in orderedSequenceDiffBest causing noms log to hang (#2153)
First: diff wasn't checking whether it had stopped before sending the
final set of changes. If the caller had stopped - and therefore no
longer reading from the changes channel - diff would hang.

Second: the same close channel was being used on 2 threads and it was
possible for both to read the close signal - causing the other to hang.
2016-07-26 14:09:20 -07:00
Vinicius Baggio Fuentes 9e7f1aaef7 go/chunks: changes convenience constructor for DynamoStore.
The convenience constructor changed in this patch takes in a aws.Config
object directly. This allows any implementation of the mentioned interface
to be passed in to Noms's Dynamo store -- giving flexibility for client
code to add their own credential acquisition mechanisms, for instance.

[fixes #2151]
2016-07-26 11:52:09 -07:00
Erik Arvidsson fcf9161d6a Include the meta field when pulling (#2152)
We need to also pull over the meta field. The references in meta are
already getting pulled over by `Chunks()`. If we do not pull over the
meta field we get a different commit value, with a different hash
which leads to newer pulls not being able to merge cleanly.

Fixes #2112
2016-07-25 14:28:04 -07:00
Rafael Weinstein b57377c1ed Chunk over value (non-type) serialization bytes (#2130)
Chunk over value (non-type) serialization bytes
2016-07-25 11:02:26 -07:00
Aaron Boodman cabc7aeb8c Emit more information when version check fails (#2145) 2016-07-24 22:34:30 -07:00
Ben Kalman 270ba908cd Introduce samples/go/blob-get, utility which downloads a noms blob (#2127)
... from a noms database. Right now it's very slow (< 100kb/s).
2016-07-22 17:50:33 -07:00
Dan Willhite c12402668a Treat diffing of structs of different types, like maps. (#2062) 2016-07-22 14:49:51 -07:00
Erik Arvidsson cb8d44b3f9 Merge pull request #2120 from arv/commit-no-meta
Commit type should always have a meta field
2016-07-21 18:29:45 -07:00
Erik Arvidsson 68e92092e5 Commit type: Inner parents struct should also have meta
This changes so that all commit struct types have a meta field
(which might be an empty struct).

Increment the serialization version since the old data does not
necessarily have the meta field.

Fixes ##2112
2016-07-21 18:25:17 -07:00
Erik Arvidsson 1ef3eb5cfa Add EqualsIgnoreHashes
Fixes #2077
2016-07-21 18:24:45 -07:00
Ben Kalman 0a176caa3d Write a new ordered diff algorithm that combines top-down and left-right (#2110)
The left-right diff is expected to return results earlier, whereas the
top-down approach is faster overall. This new diff algorithm runs both:
- early results are returned from the left-right diff.
- if/when top-down catches up, left-right is stopped and the rest of the
  changes are returned from top-down.
2016-07-21 15:40:05 -07:00
Rafael Weinstein 717745f2fc Refactor sequence_chunker.Done() (#2076)
Go SequenceChunker Refactor
2016-07-21 14:51:32 -07:00
Aaron Boodman f5b8b9f248 Don't escape the zero character in struct fields (#2121)
Toward #2109
2016-07-21 14:05:33 -07:00