1
0
Fork 0

server: Correct liza_timestamp_initial_rated to be a vector

The metabucket expects vectors, not scalars.  This causes the value
to be inaccessible when loaded by the ProcessManager for rating,
because it uses the Bucket implementation expecting vectors.

This wasn't noticed at first because it works through TAME's map.

* doc/bucket.texi (Metabucket): Clarify expected data format.
* src/server/db/MongoServerDao.js (saveQuote): Store
    `meta.liza_timestamp_initial_rated' as a vector.
master
Mike Gerwitz 2019-02-07 09:57:45 -05:00
parent 833017c359
commit 13716d240b
2 changed files with 10 additions and 2 deletions

View File

@ -122,12 +122,20 @@ A diff is applied to the underlying bucket by invoking
@node Metabucket
@section Metabucket
@cindex Metabucket
The @dfn{metabucket} is a loosely-structured key/value store
The @dfn{metabucket} is a bucket-like key/value store
separate from the data bucket.@footnote{
It is stored in the @code{meta} field on the Mongo document.}
It should be used to save data that should be accessible only to the server,
but never the client.
Data must still be formatted as a vector,
but unlike the data Bucket,
vector values are sometimes structured data instead of strings.
@devnote{A standard still needs to be devised to provide guidance for
when storing structured data is appropriate,
rather than a vector of strings.}
The client has no means by which to access the metabucket.
Custom fields can be populated by server-side DataAPIs
(@pxref{Server-Side Data API Calls}).

View File

@ -335,7 +335,7 @@ module.exports = Class( 'MongoServerDao' )
);
// meta will eventually take over for much of the above data
meta.liza_timestamp_initial_rated = quote.getRatedDate();
meta.liza_timestamp_initial_rated = [ quote.getRatedDate() ];
// save the stack so we can track this call via the oplog
save_data._stack = ( new Error() ).stack;