Commit Graph

3327 Commits

Author SHA1 Message Date
cmasone-attic
83235c7965 NBS: Calculate maxTableSize precisely (#3165)
Though Raf and I can't figure out how, it's clear that the method we
initially used for calculating the max amount of space for
snappy-compressed chunk data was incorrect. That's the root cause of
of all the chunks to be written and summing the snappy.MaxEncodedLen()
for each.

Fixes #3156
2017-02-09 11:46:06 -08:00
Rafael Weinstein
9f9a6c9137 ensure types have a name (#3166) 2017-02-09 11:44:45 -08:00
cmasone-attic
e55632e1ea Always print Bug 3156 logging (#3164)
Apparently, there's some issue running demo-server with --verbose
in prod, so we don't do it. This means that the logging info I
added isn't showing up. Change the logging code to use fmt.Fprintf()

Also, add unit test for errata functionality.

Towards #3156
2017-02-09 09:16:17 -08:00
Rafael Weinstein
ccff2044c6 remove stray file (#3163) 2017-02-08 12:27:59 -08:00
Rafael Weinstein
128207786a fix auth header (#3162) 2017-02-08 12:24:40 -08:00
Rafael Weinstein
af29700f4d Union of scalar and empty struct (#3160)
Add support for unions containing scalar values by "boxing" those scalars in that context. Also add a hash field to Struct so that empty structs have at least one field
2017-02-08 12:17:02 -08:00
Ben Kalman
b0927d852c gofmt -s -w (#3159) 2017-02-08 09:37:15 -08:00
cmasone-attic
8cfc5e6512 Gather more info about Bug 3156 (#3158)
There's some case that causes chunks that compress to more than about
55k (we think these are quite big, chunks that are many hundreds of K
in size) not to wind up correctly inserted into tables. It looks like
the snappy library believes the buffer we've allocated may not be
large enough, so it allocates its own space and this screws us up.

This patch changes two things:
1) The CRC in the NBS format is now the CRC of the _compressed_ data
2) Such chunks will be manually copied into the table, so they won't
   be missing anymore

Also, when the code detects a case where the snappy library decided to
allocate its own storage, it saves the uncompressed data off to the
side, so that it can be pushed to durable storage. Such chunks are
stored on disk or in S3 named like "<chunk-hash>-errata", and logging
is dumped out so we can figure out which tables were supposed to
contain these chunks.

Towards #3156
2017-02-07 15:43:06 -08:00
Rafael Weinstein
5a8f81f6d0 Update README.md 2017-02-07 14:44:24 -08:00
Rafael Weinstein
3cea4e9216 Graphql empty collections and types (#3157)
We need to fully map the noms types into graphql even though the mapping isn't useful, otherwise the endpoint may die when attempting to create a schema for types that aren't mapped.
2017-02-07 13:30:48 -08:00
Rafael Weinstein
487e2c9b30 GraphQL cleanup (#3154) 2017-02-07 12:08:52 -08:00
Erik Arvidsson
27c539ebd4 Update to use eslint-config-noms@1.2.0 (#3151) 2017-02-07 09:57:27 -08:00
Rafael Weinstein
00d16999e0 Better naming for graphql fields (#3153) 2017-02-06 19:45:48 -08:00
Rafael Weinstein
fff532beb3 Add experimental graphql support (#3146)
Included README.md describes initial features.

This patch includes a simple graphiql ui which is preconfigured to explore a noms/graphql endpoint
2017-02-06 19:28:54 -08:00
Mike Gray
466cab880f Remove unused samples (#3150) 2017-02-06 18:55:29 -08:00
Erik Arvidsson
f40c941dc9 Update eslint-config-noms to enforce comma-spacing (#3149) 2017-02-06 17:08:58 -08:00
Erik Arvidsson
8378d4952e Jest (#3145)
This changes to use Jest. Benefits of jest is parallel tests and jest can run the minimal set of tests that are affected by a change (by looking at dependencies).

The main work was to disentangle our cyclic dependencies. To do this I had to remove some runtime assertions in encode value as well as expose the values of a struct without going through a struct mirror.
2017-02-06 15:13:53 -08:00
cmasone-attic
ffa6de50a5 Funnel extract failure back to main goroutine (#3147)
Panics on background goroutines take down the server. This patch
hacks in a mechanism to pipe failures during NBS tableReader.extract
back to the main goroutine so the server doesn't die on this failure
and I can diagnose it.
2017-02-06 11:53:57 -08:00
cmasone-attic
8e40ee4959 First pass at compaction (#3143)
* First pass at compaction

The first cut at compaction blocks UpdateRoot() while it compacts n/2
tables down into a single, large table (where n == number of tables
named in the NBS manifest). It then attempts to update the manifest
with one referencing the compacted table, the novel tables from the
client, and the remaining upstream tables that were not compacted.

If the update fails, probably due to an optimistic lock failure, the
client drops the compacted table it just created, pulls in the tables
from the newly-discovered upstream manifest, and tries again.

Known flaws:
- may explode RAM (#3130)
- doesn't handle novel tables > max tables (#3142)
- may handle optimistic-lock-failures suboptimally (#3141)

Fixes #3132

Also, fixes #2944 because doing so simplifies some code.
2017-02-03 15:58:04 -08:00
Ben Kalman
1379fe7cb7 Pass fetch options through to updateRoot (#3140) 2017-01-31 17:24:33 -08:00
Erik Arvidsson
8b7c9742a4 Remove our custom copy-flow-files (#3139)
It was using a file watcher which was causing us to run out of inodes
on our Jenkins build. Instead, use flow-copy-source which does the
same copying without a file wathcer (we no longer used the --watch flag
anyway).
2017-01-31 14:46:32 -08:00
Ben Kalman
b3f4981213 I am back (#3138) 2017-01-31 14:26:36 -08:00
Erik Arvidsson
d74836984d yarn publish is broken (#3137) 2017-01-31 13:50:29 -08:00
Erik Arvidsson
f66a0e8a89 Update to Flow 0.38 (#3136) 2017-01-31 13:39:31 -08:00
Ben Kalman
aa583fa510 Guard JS http-batch-store accessing deleted chunk (#3134)
Workaround for https://github.com/attic-labs/noms/issues/3133.
2017-01-31 11:36:27 -08:00
Dan Willhite
10570f591e Fix print_diff when map is keyed by non-primitive (#3128) 2017-01-30 18:40:52 -08:00
Aaron Boodman
0b596da7be Add noms root command for getting and setting root of entire db (#2992)
* Add `noms root` command for getting and setting root of entire db

* fix missing import

* rebase, review feedback

* review feedback

* moar review
2017-01-30 17:34:06 -08:00
cmasone-attic
04eaf9d326 NBS dynamoManifest must perform a consistent read (#3129)
DynamoDB provides eventual read-after-write consistency, unless you
ask explicitly for strong consistency. When committing over HTTP, the
code writes a bunch of Values and then attempts to UpdateRoot to point
to one of those novel chunks. The UpdateRoot call _must_ see the
result of the prior WriteValue, or it may fail.

Fixes #3084
2017-01-30 14:53:09 -08:00
Erik Arvidsson
b287ad9462 Update run_pr_builder.sh
Add `-v` again
2017-01-27 18:03:00 -08:00
Ben Kalman
8d0cd2c109 Noms JS version 69.3.0 (#3125) 2017-01-27 16:54:23 -08:00
Ben Kalman
3528196f53 Pass the fetchOptions to writeBatch in HttpBatchStore (#3124)
This allows JS to make authenticated writes to Noms.
2017-01-27 16:32:39 -08:00
Erik Arvidsson
04ecdaa311 Revert "Update run_pr_builder.sh" (#3119)
This reverts commit 6b5e8dad0d.

Still happening...
2017-01-27 10:18:46 -08:00
Erik Arvidsson
6b5e8dad0d Update run_pr_builder.sh
Testing again
2017-01-27 09:56:57 -08:00
Erik Arvidsson
59ecc40c6e publish-to-npm: Fix python call (#3117) 2017-01-26 11:58:32 -08:00
Erik Arvidsson
2ba3a3e129 Update publish-to-npm.py for yarn (#3116) 2017-01-26 11:18:40 -08:00
Erik Arvidsson
076b88134a Integration test: Just disable samples/js/fs
samples/js/fs fails with

```
+ go test -v github.com/attic-labs/noms/samples/js/fs
=== RUN   TestIntegration
== Calling npmInstall
yarn install v0.19.1
$ cp ../../../js/noms/.babelrc ../.eslintrc.js ../../../js/noms/.flowconfig .
[1/4] Resolving packages...
success Already up-to-date.
$ yarn run build
yarn run v0.19.1
$ BABEL_ENV=production babel -d dist src 
Build step 'Execute shell' marked build as failure
```

We also have:

```
+ ls -al /var/workspace/src/github.com/attic-labs/noms/samples/js/fs
total 124
drwxrwxrwx 3 112 116  4096 Jan 26 04:08 .
drwxrwxrwx 8 112 116  4096 Jan 26 04:08 ..
-rw-rw-rw- 1 112 116    59 Jan 26 04:08 .gitignore
-rw-rw-rw- 1 112 116   244 Jan 26 04:08 dummy.go
-rw-rw-rw- 1 112 116  1162 Jan 26 04:08 integration_test.go
-rw-rw-rw- 1 112 116   666 Jan 26 04:08 package.json
drwxrwxrwx 2 112 116  4096 Jan 26 04:08 src
-rw-rw-rw- 1 112 116    13 Jan 26 04:08 test-data.txt
-rw-rw-rw- 1 112 116 93335 Jan 26 04:08 yarn.lock
```

But it is not clear why this is different than the other samples.
2017-01-25 20:14:56 -08:00
Erik Arvidsson
361ae3a77e Integration test: Debugging... 2017-01-25 20:07:42 -08:00
Erik Arvidsson
a1df010524 Integration tests: Output yarn to stdout/stderr (#3115) 2017-01-25 18:02:13 -08:00
Erik Arvidsson
6a800f6518 Integration test saga: Add -v to go test 2017-01-25 16:33:47 -08:00
Erik Arvidsson
e6bc8c9054 Manually list the integration tests (#3114) 2017-01-25 15:55:56 -08:00
Erik Arvidsson
c7db32037e Moar logging for integrations test (#3113) 2017-01-25 15:09:16 -08:00
Rafael Weinstein
a34a444f42 Fix cache/value store caching (#3111)
* Fixes a long standing bug in which the RemoteBatchStore is accidentally caching all chunks
* ValueStore's value cache now stores `Promise<?Value>` so that concurrent `readValues` of the same value can share a single decoding
* Removes the debug-only chunk hash check which keeps tripping up perf investigations
2017-01-25 14:41:15 -08:00
Erik Arvidsson
9689248028 Add more logging info for test runners (#3112) 2017-01-25 13:49:14 -08:00
Rafael Weinstein
edf8b55f26 dont use read ahead for map.first/last (#3110) 2017-01-24 13:12:09 -08:00
cmasone-attic
e72ab4a097 NBS UpdateRoot() returns false when last != nbs.Root() (#3109)
This code initially panicked in this case, because there didn't used
to be a reasonable way that a caller might wind up trying to update
away from a Root that didn't match NomsBlockStore's internal
bookkeeping. Now, given the new Flush() behavior there is. So, just
return false and allow the caller to take appropriate action.

Towards #3089
2017-01-24 11:00:21 -08:00
Rafael Weinstein
85d43b2fcd Update README.md 2017-01-24 10:13:58 -08:00
Rafael Weinstein
aaa66ea86f Update README.md 2017-01-23 16:24:43 -08:00
Aaron Boodman
7e5af655e7 bump version because of format version change (#3107) 2017-01-23 15:50:32 -08:00
Rafael Weinstein
08d9d5f4aa Introduce walk.WalkDifferentStructs (#3104)
This patch adds a static function which can walk graphs looking for (and diffing) two structs. It uses type information to avoid traversing sub-values which can't contain structs. It also uses a similar approach as sync to avoid visiting common sub-chunk-graphs.
2017-01-23 15:21:41 -08:00
Rafael Weinstein
d890a35b92 Update README.md 2017-01-23 15:19:31 -08:00