diff options
author | Tor Brede Vekterli <vekterli@vespa.ai> | 2024-04-09 13:38:16 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@vespa.ai> | 2024-04-09 13:38:16 +0000 |
commit | 65790df4dfb9e5c0ab3e1fd90fa117351bb624ef (patch) | |
tree | aa92dea2a31922d33f044d6bc4104fd5d663a0ce | |
parent | a8dd709dceca4c53096be285f35686439a7902eb (diff) |
Ensure visibility of max batch size reconfiguration in persistence thread
-rw-r--r-- | storage/src/tests/persistence/filestorage/filestormanagertest.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp index 56149bbc14d..43e6bbe1c89 100644 --- a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp +++ b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp @@ -411,9 +411,18 @@ TEST_F(FileStorManagerTest, feed_op_batch_updates_bucket_db_and_reply_bucket_inf c.manager->getFileStorHandler().set_max_feed_op_batch_size(10); BucketId bucket_id(16, 1); createBucket(bucket_id); + // The persistence thread is already running at this point, and may not have observed the max + // batch size configuration change. Trigger an implicit thread barrier by roundtripping a message. + { + auto get = make_get_command(120, "id:foo:testdoctype1:n=1:0"); + get->setAddress(_storage3); + c.top.sendDown(get); + c.top.waitForMessages(1, _waitTime); + (void)c.top.getRepliesOnce(); + } constexpr uint32_t n = 10; { - // Barrier to prevent any messages from being processed until we've enqueued all puts + // Explicit barrier to prevent any messages from being processed until we've enqueued all puts auto guard = c.manager->getFileStorHandler().lock(makeDocumentBucket(bucket_id), LockingRequirements::Exclusive); for (uint32_t i = 0; i < n; ++i) { auto put = make_put_command(120, vespalib::make_string("id:foo:testdoctype1:n=1:%u", i), Timestamp(1000) + i); |