diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2019-03-12 22:35:52 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2019-03-12 22:35:52 +0100 |
commit | b81ac20e35d5ff6f3fd5c8b541510ffabce903c6 (patch) | |
tree | a7caa5eae78b106a6764ed75b11d1abeeae5e097 /storage | |
parent | d8ecba43c97b03cd84497ac9d6cd8a803540ed16 (diff) |
Fix format strings in storage module.
Diffstat (limited to 'storage')
16 files changed, 39 insertions, 39 deletions
diff --git a/storage/src/tests/distributor/externaloperationhandlertest.cpp b/storage/src/tests/distributor/externaloperationhandlertest.cpp index a9956712679..ddf88f50c36 100644 --- a/storage/src/tests/distributor/externaloperationhandlertest.cpp +++ b/storage/src/tests/distributor/externaloperationhandlertest.cpp @@ -200,7 +200,7 @@ ExternalOperationHandlerTest::makeGetCommand(const vespalib::string& id) const { std::shared_ptr<api::GetCommand> ExternalOperationHandlerTest::makeGetCommandForUser(uint64_t id) const { - DocumentId docId(document::UserDocIdString(vespalib::make_string("userdoc:foo:%lu:bar", id))); + DocumentId docId(document::UserDocIdString(vespalib::make_string("userdoc:foo:%" PRIu64 ":bar", id))); return std::make_shared<api::GetCommand>(makeDocumentBucket(document::BucketId(0)), docId, "[all]"); } diff --git a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp index f03d2fa3647..c9285442fbc 100644 --- a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp +++ b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp @@ -1171,7 +1171,7 @@ FileStorManagerTest::testSplit1() filestorHandler.schedule(cmd, 0); filestorHandler.flush(true); - LOG(debug, "Got %" PRIu64 " replies", top.getNumReplies()); + LOG(debug, "Got %zu replies", top.getNumReplies()); CPPUNIT_ASSERT_EQUAL((size_t) 1, top.getNumReplies()); std::shared_ptr<api::PutReply> reply( std::dynamic_pointer_cast<api::PutReply>( @@ -1403,7 +1403,7 @@ FileStorManagerTest::putDoc(DummyStorageLink& top, spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); document::BucketIdFactory factory; - document::DocumentId docId(vespalib::make_string("userdoc:ns:%zu:%d", target.getId(), docNum)); + document::DocumentId docId(vespalib::make_string("userdoc:ns:%" PRIu64 ":%d", target.getId(), docNum)); document::BucketId bucket(16, factory.getBucketId(docId).getRawId()); //std::cerr << "doc bucket is " << bucket << " vs source " << source << "\n"; _node->getPersistenceProvider().createBucket( diff --git a/storage/src/tests/persistence/persistencequeuetest.cpp b/storage/src/tests/persistence/persistencequeuetest.cpp index e96ad013923..a212e65efe8 100644 --- a/storage/src/tests/persistence/persistencequeuetest.cpp +++ b/storage/src/tests/persistence/persistencequeuetest.cpp @@ -89,7 +89,7 @@ void PersistenceQueueTest::setUp() { std::shared_ptr<api::StorageMessage> PersistenceQueueTest::createPut(uint64_t bucket, uint64_t docIdx) { std::shared_ptr<document::Document> doc = _node->getTestDocMan().createDocument( - "foobar", vespalib::make_string("id:foo:testdoctype1:n=%zu:%zu", bucket, docIdx)); + "foobar", vespalib::make_string("id:foo:testdoctype1:n=%" PRIu64 ":%" PRIu64, bucket, docIdx)); auto cmd = std::make_shared<api::PutCommand>(makeDocumentBucket(document::BucketId(16, bucket)), doc, 1234); cmd->setAddress(makeSelfAddress()); return cmd; @@ -98,7 +98,7 @@ std::shared_ptr<api::StorageMessage> PersistenceQueueTest::createPut(uint64_t bu std::shared_ptr<api::StorageMessage> PersistenceQueueTest::createGet(uint64_t bucket) const { auto cmd = std::make_shared<api::GetCommand>( makeDocumentBucket(document::BucketId(16, bucket)), - document::DocumentId(vespalib::make_string("id:foo:testdoctype1:n=%zu:0", bucket)), "[all]"); + document::DocumentId(vespalib::make_string("id:foo:testdoctype1:n=%" PRIu64 ":0", bucket)), "[all]"); cmd->setAddress(makeSelfAddress()); return cmd; } diff --git a/storage/src/vespa/storage/bucketdb/bucketmanager.cpp b/storage/src/vespa/storage/bucketdb/bucketmanager.cpp index a1c1742edb5..0def395aff0 100644 --- a/storage/src/vespa/storage/bucketdb/bucketmanager.cpp +++ b/storage/src/vespa/storage/bucketdb/bucketmanager.cpp @@ -552,7 +552,7 @@ BucketManager::processRequestBucketInfoCommands(document::BucketSpace bucketSpac const auto our_hash = distribution->getNodeGraph().getDistributionConfigHash(); - LOG(debug, "Processing %" PRIu64 " queued request bucket info commands. " + LOG(debug, "Processing %zu queued request bucket info commands. " "Using cluster state '%s' and distribution hash '%s'", reqs.size(), clusterState->toString().c_str(), @@ -633,7 +633,7 @@ BucketManager::processRequestBucketInfoCommands(document::BucketSpace bucketSpac } _metrics->fullBucketInfoRequestSize.addValue(requests.size()); - LOG(debug, "Processing %" PRIu64 " bucket info requests for " + LOG(debug, "Processing %zu bucket info requests for " "distributors %s, using system state %s", requests.size(), distrList.str().c_str(), clusterState->toString().c_str()); @@ -688,7 +688,7 @@ BucketManager::verifyAndUpdateLastModified(api::StorageCommand& cmd, const document::Bucket &bucket, uint64_t lastModified) { - LOG(spam, "Received operation %s with modification timestamp %zu", + LOG(spam, "Received operation %s with modification timestamp %" PRIu64, cmd.toString().c_str(), lastModified); @@ -716,8 +716,8 @@ BucketManager::verifyAndUpdateLastModified(api::StorageCommand& cmd, api::ReturnCode::STALE_TIMESTAMP, vespalib::make_string( "Received command %s with a lower/equal timestamp " - " (%zu) than the last operation received for " - "bucket %s, with timestamp %zu", + " (%" PRIu64 ") than the last operation received for " + "bucket %s, with timestamp %" PRIu64, cmd.toString().c_str(), lastModified, bucket.toString().c_str(), diff --git a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp index ea621bef7f3..a223001af79 100644 --- a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp +++ b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp @@ -87,7 +87,7 @@ BucketDBUpdater::sendRequestBucketInfo( new api::RequestBucketInfoCommand(bucket.getBucketSpace(), buckets)); LOG(debug, - "Sending request bucket info command %lu for " + "Sending request bucket info command %" PRIu64 " for " "bucket %s to node %u", msg->getMsgId(), bucket.toString().c_str(), diff --git a/storage/src/vespa/storage/distributor/messagetracker.cpp b/storage/src/vespa/storage/distributor/messagetracker.cpp index 6568cec9a80..c20b862597a 100644 --- a/storage/src/vespa/storage/distributor/messagetracker.cpp +++ b/storage/src/vespa/storage/distributor/messagetracker.cpp @@ -33,7 +33,7 @@ MessageTracker::handleReply(api::BucketReply& reply) { std::map<uint64_t, uint16_t>::iterator found = _sentMessages.find(reply.getMsgId()); if (found == _sentMessages.end()) { - LOG(warning, "Received reply %zu for callback which we have no recollection of", reply.getMsgId()); + LOG(warning, "Received reply %" PRIu64 " for callback which we have no recollection of", reply.getMsgId()); return (uint16_t)-1; } else { uint16_t node = found->second; diff --git a/storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp index 02317ea3736..6f82ceaab92 100644 --- a/storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp @@ -151,7 +151,7 @@ UpdateOperation::onReceive(DistributorMessageSender& sender, if (_results[i].oldTs < oldTs) { LOG(warning, "Update operation for '%s' in bucket %s updated documents with different timestamps. " "This should not happen and may indicate undetected replica divergence. " - "Found ts=%zu on node %u, ts=%zu on node %u", + "Found ts=%" PRIu64 " on node %u, ts=%" PRIu64 " on node %u", reply.getDocumentId().toString().c_str(), reply.getBucket().toString().c_str(), _results[i].oldTs, _results[i].nodeId, diff --git a/storage/src/vespa/storage/distributor/operations/external/visitoroperation.cpp b/storage/src/vespa/storage/distributor/operations/external/visitoroperation.cpp index 9fa7a319fa9..cd18148a662 100644 --- a/storage/src/vespa/storage/distributor/operations/external/visitoroperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/external/visitoroperation.cpp @@ -130,7 +130,7 @@ VisitorOperation::timeLeft() const noexcept std::chrono::duration_cast<std::chrono::milliseconds>(elapsed).count()); LOG(spam, - "Checking if visitor has timed out: elapsed=%zu ms, timeout=%u ms", + "Checking if visitor has timed out: elapsed=%" PRIu64 " ms, timeout=%u ms", timeSpent.getTime(), _msg->getTimeout()); @@ -958,7 +958,7 @@ VisitorOperation::sendStorageVisitor(uint16_t node, cmd->setTimeout(timeLeft()); LOG(spam, "Priority is %d", cmd->getPriority()); - LOG(debug, "Sending CreateVisitor command %zu for storage visitor '%s' to %s", + LOG(debug, "Sending CreateVisitor command %" PRIu64 " for storage visitor '%s' to %s", cmd->getMsgId(), storageInstanceId.c_str(), cmd->getAddress()->toString().c_str()); @@ -979,8 +979,8 @@ VisitorOperation::sendReply(const api::ReturnCode& code, DistributorMessageSende reply->setVisitorStatistics(_visitorStatistics); LOG(debug, - "Sending CreateVisitor reply %zu with return code '%s' for visitor " - "'%s', msg id '%zu' back to client", + "Sending CreateVisitor reply %" PRIu64 " with return code '%s' for visitor " + "'%s', msg id '%" PRIu64 "' back to client", reply->getMsgId(), code.toString().c_str(), _msg->getInstanceId().c_str(), _msg->getMsgId()); diff --git a/storage/src/vespa/storage/distributor/pendingmessagetracker.cpp b/storage/src/vespa/storage/distributor/pendingmessagetracker.cpp index 52a35bffc98..715ac1722b4 100644 --- a/storage/src/vespa/storage/distributor/pendingmessagetracker.cpp +++ b/storage/src/vespa/storage/distributor/pendingmessagetracker.cpp @@ -95,7 +95,7 @@ PendingMessageTracker::insert(const std::shared_ptr<api::StorageMessage>& msg) _nodeInfo.incPending(msg->getAddress()->getIndex()); - LOG(debug, "Sending message %s with id %zu to %s", + LOG(debug, "Sending message %s with id %" PRIu64 " to %s", msg->toString().c_str(), msg->getMsgId(), msg->getAddress()->toString().c_str()); } } @@ -119,7 +119,7 @@ PendingMessageTracker::reply(const api::StorageReply& r) if (code == api::ReturnCode::BUSY || code == api::ReturnCode::TIMEOUT) { _nodeInfo.setBusy(r.getAddress()->getIndex(), _nodeBusyDuration); } - LOG(debug, "Erased message with id %zu", msgId); + LOG(debug, "Erased message with id %" PRIu64, msgId); msgs.erase(msgId); } diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp index d7207f43c7b..78498be2510 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp +++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp @@ -1181,7 +1181,7 @@ FileStorHandlerImpl::BucketLock::BucketLock(const vespalib::MonitorGuard & guard { if (_bucket.getBucketId().getRawId() != 0) { _stripe.lock(guard, _bucket, lockReq, Stripe::LockEntry(priority, msgType, msgId)); - LOG(debug, "Locked bucket %s for message %zu with priority %u in mode %s", + LOG(debug, "Locked bucket %s for message %" PRIu64 " with priority %u in mode %s", bucket.getBucketId().toString().c_str(), msgId, priority, api::to_string(lockReq)); } } @@ -1190,7 +1190,7 @@ FileStorHandlerImpl::BucketLock::BucketLock(const vespalib::MonitorGuard & guard FileStorHandlerImpl::BucketLock::~BucketLock() { if (_bucket.getBucketId().getRawId() != 0) { _stripe.release(_bucket, _lockReq, _uniqueMsgId); - LOG(debug, "Unlocked bucket %s for message %zu in mode %s", + LOG(debug, "Unlocked bucket %s for message %" PRIu64 " in mode %s", _bucket.getBucketId().toString().c_str(), _uniqueMsgId, api::to_string(_lockReq)); } } diff --git a/storage/src/vespa/storage/persistence/mergehandler.cpp b/storage/src/vespa/storage/persistence/mergehandler.cpp index 1e9cc7c0cde..f5d7bc57354 100644 --- a/storage/src/vespa/storage/persistence/mergehandler.cpp +++ b/storage/src/vespa/storage/persistence/mergehandler.cpp @@ -546,7 +546,7 @@ MergeHandler::fetchLocalData( } } - LOG(spam, "Fetched %" PRIu64 " entries locally to fill out diff for %s. " + LOG(spam, "Fetched %zu entries locally to fill out diff for %s. " "Still %d unfilled entries", entries.size(), bucket.toString().c_str(), countUnfilledEntries(diff)); } @@ -1227,7 +1227,7 @@ MergeHandler::handleGetBucketDiff(api::GetBucketDiffCommand& cmd, } // Send reply LOG(spam, "Replying to GetBucketDiff %" PRIu64 " for %s to node %d" - ". Diff has %" PRIu64 " entries. (%" PRIu64 " before compaction)", + ". Diff has %zu entries. (%zu before compaction)", cmd.getMsgId(), bucket.toString().c_str(), cmd.getNodes()[index - 1].index, final.size(), local.size()); @@ -1248,7 +1248,7 @@ MergeHandler::handleGetBucketDiff(api::GetBucketDiffCommand& cmd, s->pendingGetDiff->setPriority(cmd.getPriority()); LOG(spam, "Sending GetBucketDiff for %s on to node %d, " - "added %" PRIu64 " new entries to diff.", + "added %zu new entries to diff.", bucket.toString().c_str(), cmd.getNodes()[index + 1].index, local.size() - remote.size()); std::shared_ptr<api::GetBucketDiffCommand> cmd2( @@ -1354,7 +1354,7 @@ MergeHandler::handleGetBucketDiffReply(api::GetBucketDiffReply& reply, // Exists in send on list, send on! replyToSend = s.pendingGetDiff; LOG(spam, "Received GetBucketDiffReply for %s with diff of " - "size %" PRIu64 ". Sending it on.", + "size %zu. Sending it on.", bucket.toString().c_str(), reply.getDiff().size()); s.pendingGetDiff->getDiff().swap(reply.getDiff()); } @@ -1400,7 +1400,7 @@ MergeHandler::handleApplyBucketDiff(api::ApplyBucketDiffCommand& cmd, _env._metrics.mergeDataReadLatency.addValue( startTime.getElapsedTimeAsDouble()); } else { - LOG(spam, "Merge(%s): Moving %" PRIu64 " entries, didn't need " + LOG(spam, "Merge(%s): Moving %zu entries, didn't need " "local data on node %u (%u).", bucket.toString().c_str(), cmd.getDiff().size(), diff --git a/storage/src/vespa/storage/persistence/persistencethread.cpp b/storage/src/vespa/storage/persistence/persistencethread.cpp index 55f7c076244..b738a9ecf00 100644 --- a/storage/src/vespa/storage/persistence/persistencethread.cpp +++ b/storage/src/vespa/storage/persistence/persistencethread.cpp @@ -935,7 +935,7 @@ PersistenceThread::flushAllReplies( } for (uint32_t i = 0; i < replies.size(); ++i) { - LOG(spam, "Sending reply up (batched): %s %zu", + LOG(spam, "Sending reply up (batched): %s %" PRIu64, replies[i]->getReply()->toString().c_str(), replies[i]->getReply()->getMsgId()); _env._fileStorHandler.sendReply(replies[i]->getReply()); } @@ -982,7 +982,7 @@ void PersistenceThread::processMessages(FileStorHandler::LockedMessage & lock) break; } } else { - LOG(spam, "Sending reply up: %s %zu", + LOG(spam, "Sending reply up: %s %" PRIu64, tracker->getReply()->toString().c_str(), tracker->getReply()->getMsgId()); _env._fileStorHandler.sendReply(tracker->getReply()); break; diff --git a/storage/src/vespa/storage/storageserver/mergethrottler.cpp b/storage/src/vespa/storage/storageserver/mergethrottler.cpp index 92ed01ca5d9..83e31b78954 100644 --- a/storage/src/vespa/storage/storageserver/mergethrottler.cpp +++ b/storage/src/vespa/storage/storageserver/mergethrottler.cpp @@ -136,7 +136,7 @@ MergeThrottler::MergeNodeSequence::getNextNodeInChain() const // assert(_sortedNodes[_cmd.getChain().size()].index == _thisIndex); if (_sortedNodes[_cmd.getChain().size()].index != _thisIndex) { // Some added paranoia output - LOG(error, "For %s;_sortedNodes[%" PRIu64 "].index (%u) != %u", + LOG(error, "For %s;_sortedNodes[%zu].index (%u) != %u", _cmd.toString().c_str(), _cmd.getChain().size(), _sortedNodes[_cmd.getChain().size()].index, _thisIndex); assert(!"_sortedNodes[_cmd.getChain().size()].index != _thisIndex) failed"); @@ -278,7 +278,7 @@ MergeThrottler::onClose() } if (LOG_WOULD_LOG(debug)) { vespalib::LockGuard lock(_stateLock); - LOG(debug, "onClose; active: %" PRIu64 ", queued: %" PRIu64, + LOG(debug, "onClose; active: %zu, queued: %zu", _merges.size(), _queue.size()); } if (_thread) { @@ -348,7 +348,7 @@ MergeThrottler::onFlush(bool /*downwards*/) } } - LOG(debug, "Flushed %" PRIu64 " unfinished or pending merge operations", + LOG(debug, "Flushed %zu unfinished or pending merge operations", flushable.size()); _merges.clear(); @@ -635,7 +635,7 @@ MergeThrottler::run(framework::ThreadHandle& thread) up.swap(_messagesUp); } - LOG(spam, "messages up: %" PRIu64 ", down: %" PRIu64, + LOG(spam, "messages up: %zu, down: %zu", up.size(), down.size()); // Message lock has been relinquished. Now actually do something diff --git a/storage/src/vespa/storage/storageserver/servicelayernode.cpp b/storage/src/vespa/storage/storageserver/servicelayernode.cpp index ad1f38e2b40..6606b24288e 100644 --- a/storage/src/vespa/storage/storageserver/servicelayernode.cpp +++ b/storage/src/vespa/storage/storageserver/servicelayernode.cpp @@ -142,7 +142,7 @@ ServiceLayerNode::initializeNodeSpecific() ns.setReliability(_serverConfig->nodeReliability); for (uint16_t i=0; i<_serverConfig->diskCapacity.size(); ++i) { if (i >= ns.getDiskCount()) { - LOG(warning, "Capacity configured for partition %" PRIu64 " but only %u partitions found.", + LOG(warning, "Capacity configured for partition %zu but only %u partitions found.", _serverConfig->diskCapacity.size(), ns.getDiskCount()); continue; } diff --git a/storage/src/vespa/storage/storageserver/statemanager.cpp b/storage/src/vespa/storage/storageserver/statemanager.cpp index 77d9299169f..95cb5dec696 100644 --- a/storage/src/vespa/storage/storageserver/statemanager.cpp +++ b/storage/src/vespa/storage/storageserver/statemanager.cpp @@ -548,7 +548,7 @@ StateManager::sendGetNodeStateReplies(framework::MilliSecTime olderThanTime, if (node != 0xffff && node != it->second->getSourceIndex()) { ++it; } else if (!olderThanTime.isSet() || it->first < olderThanTime) { - LOG(debug, "Sending reply to msg with id %lu", + LOG(debug, "Sending reply to msg with id %" PRIu64, it->second->getMsgId()); replies.emplace_back(std::make_shared<api::GetNodeStateReply>(*it->second, *_nodeState)); diff --git a/storage/src/vespa/storage/visiting/visitor.cpp b/storage/src/vespa/storage/visiting/visitor.cpp index 9e927a24d9c..97ae59d3344 100644 --- a/storage/src/vespa/storage/visiting/visitor.cpp +++ b/storage/src/vespa/storage/visiting/visitor.cpp @@ -193,7 +193,7 @@ Visitor::VisitorTarget::discardQueuedMessages() it(_queuedMessages.begin()), e(_queuedMessages.end()); it != e; ++it) { - LOG(spam, "Erasing queued message with id %zu", it->second); + LOG(spam, "Erasing queued message with id %" PRIu64, it->second); releaseMetaForMessageId(it->second); } _queuedMessages.clear(); @@ -210,7 +210,7 @@ Visitor::BucketIterationState::~BucketIterationState() cmd->setPriority(0); LOG(debug, "Visitor '%s' sending DestroyIteratorCommand for %s, " - "iterator id %zu.", + "iterator id %" PRIu64 ".", _visitor._id.c_str(), _bucket.getBucketId().toString().c_str(), uint64_t(_iteratorId)); @@ -313,14 +313,14 @@ Visitor::sendDocumentApiMessage(VisitorTarget::MessageMeta& msgMeta) { _visitorOptions._maxPending)); LOG(spam, - "Visitor '%s' enqueueing message with id %zu", + "Visitor '%s' enqueueing message with id %" PRIu64, _id.c_str(), msgMeta.messageId); _visitorTarget._queuedMessages.insert(std::make_pair( framework::MicroSecTime(0), msgMeta.messageId)); } else { LOG(spam, - "Visitor '%s' immediately sending message '%s' with id %zu", + "Visitor '%s' immediately sending message '%s' with id %" PRIu64, _id.c_str(), cmd.toString().c_str(), msgMeta.messageId); @@ -602,7 +602,7 @@ Visitor::start(api::VisitorId id, api::StorageMessage::Id cmdId, _state = STATE_RUNNING; - LOG(debug, "Starting visitor '%s' for %" PRIu64 " buckets from %" PRIu64 " to " + LOG(debug, "Starting visitor '%s' for %zu buckets from %" PRIu64 " to " "%" PRIu64 ". First is %s. Max pending replies: %u, include " "removes: %s, field set: %s.", _id.c_str(), |