Our Number encoding consists of two parts. Firsts we convert the float
into f * 2**exp, then we uvarint encode f and exp. However, we didn't
normalize f so in theory we could end up with multiple representations
of the same number.
This changes the representation to make the f the smallest possible
integer that fulfills the formula above.
For example we used to encode 256 as (0x100, 0) but with this we instead
encode it as (0x01, 8).
Fixes#2307
1. Decoder no longer needed to remove struct cycles. That happened as we decoded
2. Remove no-op tests.
3. Remove dead code
4. Refactor and add test.
5. Just moving code around (mostly type_cache -> make_type)
6. Remove (no longer necessary) typeDepth counter in ValueDecoder
Introduce a "lock" hash into NBS manifests to address the bad
interaction between Flush() and optimistic locking. Our original
design didn't include Flush(), which changes the set of tables without
updating the root. Thus... an optimistic locking strategy predicated
on checking the currently-persisted root hash is not robust to
interleaved Flush() calls from multiple clients.
Fixes#3349
When we clone it is possible to run into loops between named and
unnamed structs. We need to stop cloning the type tree when we see
cycle.
Also update Describe to print the actual type tree, even if it is
invalid.
This moves the type off from the value and instead we compute it as we ask for.
This also changes how we detect cycles. If a named struct contains a struct with the
same name we now create a cycle between them. This also means that cycle types
now take a string and not a number.
For encoding we no longer write the type with the value (unless it is a types.Ref).
This is a format change so this takes us to 7.6
Fixes#3328Fixes#3325Fixes#3324Fixes#3323
* Add HasMany() to the ChunkStore interface
We'll need this as a part of #3180
* Rip out hinting
The hinting mechanism used to assist in server-side validation
of values served us well, but now it's in the way of building a
more suitable validation strategy. Tear it out and go without
validation for a hot minute until #3180 gets done.
Fixes#3178
* Implement server-side lazy ref validation
The server, when handling writeValue, now just keeps track of all the
refs it sees in the novel chunks coming from the client. Once it's
processed all the incoming chunks, it just does a big bulk HasMany to
determine if any of them aren't present in the storage backend.
Fixes#3180
* Remove chunk-write-order requirements
With our old validation strategy, it was critical that
chunk graphs be written bottom-up, during both novel value
creation and sync. With the strategy implemented in #3180,
this is no longer required, which lets us get rid of a bunch
of machinery:
1) The reverse-order hack in httpBatchStore
2) the EnumerationOrder stuff in NomsBlockCache
3) the orderedPutCache in datas/
4) the refHeight arg on SchedulePut()
Fixes#2982
BREAKING CHANGE
This removes the `Type()` method from the `types.Value` interface.
Instead use the `types.TypeOf(v types.Value) bool` function.
Fixes#3324
DynamoDB doesn't allow empty strings in records. We were sending an
empty string in the case where a store had no tables in it. Instead,
the right thing is to leave this attribute out of the record, and then
detect the case where the attribute is empty when reading the record.
* Update struct in memory representation
To contain struct name and field names.
This is in preparation for removing types from the value.
Towards ##3324
* Rename structFields to structTypeFields
* Undo change in vendoring
* searchField and copy
We were not enforcing the order between two cycle types. In other words
the following two should be equal:
```
Cycle<0> | Cycle<1> = Cycle<1> | Cycle<0>
```
This is needed by attic and it uses internal APIs so it has to be
exported 😢
A better path forward would be to fully implement intersection types
but that is a large change for an edge case feature.
For the longest time, there's been a 'go vet' warning telling us that
when we build a custom http.Client in http_batch_store.go, we were
copying a Mutex down in there. That seems like not what you want to do.
Turns out we should be creating our own http.Transport object and
sharing that, instead of copying the default one every time we build
a new httpBatchStore.
This adds optional fields to structs.
New version: 7.4
To create a struct type with optional fields use types.MakeStructType2
There are some API changes in this commit and there will be some more in followup commits.
Fixes#2327