Merge branch 'master' into docs/examples-for-local-dev

This commit is contained in:
JR Conlin 2019-12-13 17:07:52 -08:00 committed by GitHub
commit 2ba6642f44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -1,2 +1,2 @@
# Temp limit on the number of incoming records (See issue #298/#333)
limits.max_total_records=1999
limits.max_total_records=1666

View File

@ -81,6 +81,8 @@ pub(super) struct SpannerDbSession {
pub(super) mutations: Option<Vec<Mutation>>,
in_write_transaction: bool,
execute_sql_count: u64,
/// Whether touch_collection has already been called
touched_collection: bool,
}
#[derive(Clone, Debug)]
@ -816,6 +818,11 @@ impl SpannerDb {
// buffered on the client side and only issued to Spanner in the final
// transaction Commit.
let timestamp = self.timestamp()?;
if self.session.borrow().touched_collection {
// No need to touch it again
return Ok(timestamp);
}
let sqlparams = params! {
"fxa_uid" => user_id.fxa_uid.clone(),
"fxa_kid" => user_id.fxa_kid.clone(),
@ -858,6 +865,7 @@ impl SpannerDb {
.param_types(sql_types)
.execute(&self.conn)?;
}
self.session.borrow_mut().touched_collection = true;
Ok(timestamp)
}

View File

@ -259,10 +259,6 @@ pub fn post_collection_batch(
// Spanner we would pay twice the mutations for those pending
// items (once writing them to to batch_bsos, then again
// writing them to bsos)
// NOTE: Unfortunately this means we make two calls to
// touch_collection (in post_bsos and then commit_batch). The
// second touch is redundant, writing the same timestamp
Either::A(
coll.db
.post_bsos(params::PostBsos {