Commit Graph

3613 Commits

Author SHA1 Message Date
Rafael Weinstein a95b2ba9ff Collection test (#3624)
* loadLeafSeqs => loadLeafCollections

* Collection tests examine leaf node counts
2017-08-18 13:40:54 -07:00
Jesse Ditson 5db3cf1679 kingpin docs, noms blob [put | get] (#3621)
* use kingpin for help and new commands, set up dummy command for noms blob

* document existing commands using kingpin

* remove noms-get and noms-set in favor of new noms blob command

* normalize bool flags in tests, remove redundant cases that kingpin now handles

* add kingpin to vendor files

* make profile flags global

* move --verbose and --quiet to global flags
2017-08-16 16:35:22 -07:00
Dan Willhite 0c14fbad05 Ensure NewStreamingMap and NewStreamingSet panic when input is not ordered (#3570)
Fixes #3560
2017-08-16 11:37:40 -07:00
Rafael Weinstein 40be27c23f further nbs stats cleanup (#3614) 2017-08-06 22:06:47 -07:00
Rafael Weinstein 15bf51cf28 use real uncompressed count (#3613) 2017-08-06 21:13:41 -07:00
Rafael Weinstein 2ab75f4233 record logical (uncompressed) bytes per persist in metrics (#3612) 2017-08-06 18:04:26 -07:00
cmasone-attic 89bdfbd981 NBS: Defer AWS reads when opening a table with cached index (#3610)
Prior to this patch, whenever we created a chunkSource for a table
persisted to AWS, awsTablePersister::Open() would hit DynamoDB to
check whether the table data was stored there. That's how it knew
whether to create a dynamoTableReader or an s3TableReader. This
results in consulting Dynamo (or the in-memory small-table cache)
every time we go to open a table. Most of the time, this isn't
necessary, as we separately cache table indices and really only
need that data at Open() time.

This patch defers reading table data if possible.

Fixes #3607
2017-08-04 13:14:53 -07:00
Jesse Ditson bb6f68e1e6 update README for OSXFuse (#3611) 2017-08-03 19:33:25 -07:00
cmasone-attic 0d5fb82197 NBS: populate small table cache on Open (#3608)
This will likely bloat the cache with tables no one's going to read
data from, BUT doing this also means that most checks to see if a table
is in Dynamo at all can proceed locally. Stopgap until #3607 lands
2017-07-28 13:26:38 -07:00
cmasone-attic ac0e65a782 NBS: Read small tables with eventually consistent reads first (#3606)
Fail over to fully-consistent reads if no result. This means that
misses will get more expensive, but hits will cost us half what they
were costing in the initial version of the code.

Fixes #3604
2017-07-28 11:41:44 -07:00
cmasone-attic 497a97e9d2 NBS: increase size of small-table memory cache (#3605)
Looking at metrics on staging today, there are frequent spikes of
tens of thousands of throttled DynamoDB reads. One explanation is
that we're constantly evicting 'hot' tables from the in-memory
cache because the working set is larger than the space we've
allotted for the cache.
2017-07-28 09:56:27 -07:00
cmasone-attic 1145546a64 NBS: Store small tables in DynamoDB when persisting to AWS (#3603)
There seems to be a floor on the amount of time required to persist
small objects to S3. For workloads that generate lots of small tables,
this can really add up. DynamoDB is much faster to read/write, and can
hold items of up to 400k. This patch stores tables with < 64 chunks
that are < 400k in DynamoDB, caching them in memory on persist and
open to reduce load on the back end.

Fixes #3559
2017-07-27 13:08:43 -07:00
Rafael Weinstein f290a711c2 BlobEditor (#3599) 2017-07-25 13:40:49 -07:00
Rafael Weinstein cd0c27a565 minor test cleanup (#3600) 2017-07-24 16:01:36 -07:00
Rafael Weinstein 6779a14781 NBS: Commit locks out Rebasers for less time (#3598)
Persisting tables now tacks place outside the manifest fetch lock so rebasers don't spend time blocking on writers persisting.
2017-07-21 08:51:13 -07:00
Rafael Weinstein 10e60df1e8 preflush non-trivial tables (#3597) 2017-07-20 16:47:12 -07:00
cmasone-attic f1c0b80bf6 Allow server to re-try commits if it can (#3596)
Right now, the only kinds of Commits that the server will retry are those
to different datasets. That is, if another client concurrently landed a change 
to some other dataset, and that is the only thing that causes your Commit 
attempt to fail, the server will retry.
 
Fixes #3582
2017-07-20 14:24:05 -07:00
cmasone-attic ccdf08c4f8 NBS: Serialize Commit() calls within a process (#3594)
This patch uses process-wide per-store locking to ensure that only one
NomsBlockStore instance is ever trying to update the upstream NBS
manifest at a time. It also locks out attempts to fetch the manifest
contents during that window.

Conjoining is now much simpler. Since only one instance can ever be in
the critical path of Commit at a time, and conjoining is triggered on
that critical path, we now simply perform the conjoin while excluding
all other in-process NBS instances. Hopefully, locking out instances
who want to fetch the manifest contents during a conjoin won't cripple
performance.

Fixes issue #3583
2017-07-20 14:04:43 -07:00
Rafael Weinstein 44941ee44c Refactor Blob reading (#3593) 2017-07-19 15:01:44 -07:00
Eric Halpern b7a96bc591 Use log.PrintXXX rather than fmt.PrintXXX for informational messages (#3591)
All messages emitted from non-cli code are now output through the standard
logger rather than directly to stdout. This gives code that embeds noms control
over how messages are logged (using log.SetFlags and log.SetOutput).

When the noms cli is used, the logger is initialized so that it only prints the
string logged. In other cases, the log setup is left to the embedding code.

toward: #3590
2017-07-18 11:24:38 -07:00
Rafael Weinstein 22e5b323e4 List Editor (#3586) 2017-07-13 15:37:48 -07:00
Erik Arvidsson 1b20287914 MarshalType: Make sure we use the user provided name (#3585)
We need to use getStructName in MarshalType too.

Fixes https://github.com/attic-labs/attic/issues/2289
2017-07-12 14:30:26 -07:00
cmasone-attic 39634469b8 NBS: Prevent concurrent loading of the same table index (#3584)
By adding per-entry locking to indexCache, this patch allows both NBS
storage backends to ensure that only one goroutine is loading a given
table index at a time. Previoudly, if multiple readers tried to open
the same table at the same time, it was possible for both to get a
cache-miss and then read in the table index at the same time, which
wastes memory.  Now, one will win the race, load the index, and then
the other will see a cache hit.

Fixes #3581
2017-07-12 11:41:05 -07:00
Rafael Weinstein e21a2ff00e fix manifest cache race (#3579) 2017-06-30 10:25:28 -07:00
Aaron Boodman b4a64513c0 debounce concurrent calls to Rebase() (#3578)
* debounce concurrent calls to Rebase()

* make tests compile
2017-06-29 11:37:46 -07:00
Rafael Weinstein 0736ca8b6c add store-granularity locking to manifest cache (#3576) 2017-06-28 17:53:09 -07:00
cmasone-attic fa40c6044f NBS: updateManifest() fails fast if Update is DOOOOOOMED (#3575)
If NomsBlockStore can assume that its manifest is a cachingManifest,
it can pre-emptively check to see if someone else in-process has
already moved the manifest forward and, if so, fail early.

Fixes #3574
2017-06-28 13:04:33 -07:00
cmasone-attic f100d213e8 Fix httpChunkStore race between Put/Commit and Close (#3573)
Fixes #3572
2017-06-27 15:57:36 -07:00
cmasone-attic 4e7db2cd49 Fix httpChunkStore race between Close() and Has/Get (#3571)
In httpChunkStore, calls to Get/Has and friends put a request object
with a 'return channel' onto a queue channel, and then block on the
return channel. The queue channel was buffered, which made it
impossible to cause Get, Has et al to terminate reliably when the
store was closed.

This patch removes the buffering on the channel so we can
deterministically bail from Get/Has et al when closing the store. I
don't think we were actually seeing any benefit from the buffer on the
queue channels, because everywhere we write to one of them we
immediately block on another channel, waiting for the result of the
request.

Fixes #3566
2017-06-27 13:02:29 -07:00
Rafael Weinstein 2fb9ba5b5e Update README.md 2017-06-22 04:25:50 -07:00
Rafael Weinstein fe0fc3ad86 Introduce SetEditor, Nestable Editors (#3557) 2017-06-21 15:22:04 -07:00
cmasone-attic b2874662e2 Basic doc for running NBS on AWS (#3558)
Fixes #3546
2017-06-21 15:19:46 -07:00
cmasone-attic bfe45c489e NBS: Fix usage of manifestCache (#3556)
There were races in both manifest implementations, between cache usage
in ParseIfExists() and Update(). It was possible for Update() calls to
occur between the time that ParseIfExists() read the manifest data and
the time it updated the cache. This led to newer manifest content
getting clobbered in the cache by out-of-date manifest content.

The new approach takes caching out of the hands of the manifest impls,
instead wrapping a shared caching layer around the outside.

Fixes #3551
2017-06-21 13:10:39 -07:00
cmasone-attic 9b9a272c6f Add fsTableCache tests missed in previous patch (#3552) 2017-06-20 13:42:37 -07:00
Rafael Weinstein 763a87aa60 Reland advance to fix (#3555) 2017-06-20 12:45:51 -07:00
Rafael Weinstein 0c3af1c1c5 Revert "sequenceChunker.advanceTo avoid resuming over items it already consumed (#3553)" (#3554) 2017-06-20 12:39:58 -07:00
Rafael Weinstein d2cc508729 sequenceChunker.advanceTo avoid resuming over items it already consumed (#3553) 2017-06-20 12:34:47 -07:00
Rafael Weinstein 2035657441 remove dead code (#3549) 2017-06-16 15:54:08 -07:00
Rafael Weinstein 70d9564b18 SequenceCursor.advanceTo shouldnt step out of parent sequence (#3548) 2017-06-16 09:56:47 -07:00
Rafael Weinstein e0f68b08bd Minor fixes to MapEditor (#3547) 2017-06-15 17:28:49 -07:00
Rafael Weinstein 1796d2f865 Streaming p tree updates + Map Editor (#3545) 2017-06-15 15:49:04 -07:00
Rafael Weinstein 7251afe285 dont clone cursors in sequence chunker (#3541) 2017-06-14 11:59:18 -07:00
Rafael Weinstein 70f145e3de trivial sequence chunking refactor (#3540) 2017-06-13 19:21:00 -07:00
Rafael Weinstein d675e4d8f4 Chunking V2 (#3521) 2017-06-13 10:48:03 -07:00
Aaron Boodman f10f5b5282 Add [Must][Un]MarshalOpt - which provides more control over how values are marshaled and unmarshaled (#3539)
Toward #2376
2017-06-10 18:39:07 -07:00
cmasone-attic 185bd54b34 Put root in httpChunkStore /getRefs query string (#3538)
Fixes #3491
2017-06-09 15:57:12 -07:00
Rafael Weinstein daf97e4cc4 Remove some uses of Backoff (#3533) 2017-06-09 13:10:40 -07:00
cmasone-attic 753aacb8f7 NBS: Fix race between Rebase() and Commit() (#3532) 2017-06-09 12:31:55 -07:00
Rafael Weinstein 3ff92950d8 Revert removal of |last| from Commit() (#3531) 2017-06-09 11:20:45 -07:00
cmasone-attic 0fd37ba20d Add chunks.Factory::CreateStoreFromCache() (#3529)
Add a method to chunks.Factory that allows the caller to
signal that it's willing to try to make forward progress
using an out-of-date ChunkStore. This allows AWSStoreFactory
and LocalStoreFactory to vend NBS instances without hammering
persistent storage every time.

Towards #3491
2017-06-09 08:52:22 -07:00