Back out "Log metadata size mismatch on NFS READ"

Summary:
Original commit changeset: 968c2866d8fd

Original Phabricator Diff: D41393677 (6384a0f39a)

Reviewed By: xavierd

Differential Revision: D41624043

fbshipit-source-id: 051981d201d28905d97385012eecf58e75ce8634
This commit is contained in:
Mark Shroyer 2022-11-30 14:56:35 -08:00 committed by Facebook GitHub Bot
parent 6d9556b987
commit 83bb997ee9
2 changed files with 2 additions and 40 deletions

View File

@ -58,7 +58,6 @@ class Nfsd3ServerProcessor final : public RpcServerProcessor {
stopPromise_{stopPromise},
processAccessLog_{processAccessLog},
traceDetailedArguments_(traceDetailedArguments),
metadataSizeMismatchLogged_(false),
traceBus_(traceBus) {}
Nfsd3ServerProcessor(const Nfsd3ServerProcessor&) = delete;
@ -184,9 +183,6 @@ class Nfsd3ServerProcessor final : public RpcServerProcessor {
ProcessAccessLog& processAccessLog_;
std::atomic_int32_t numberOfClients_;
std::atomic<size_t>& traceDetailedArguments_;
// TODO(T136422586): Remove once we've identified the cause of mismatched file
// size metadata.
std::atomic_bool metadataSizeMismatchLogged_;
std::shared_ptr<TraceBus<NfsTraceEvent>>& traceBus_;
};
@ -566,10 +562,8 @@ ImmediateFuture<folly::Unit> Nfsd3ServerProcessor::read(
.thenTry([this, ser = std::move(ser), ino = args.file.ino, &context](
folly::Try<NfsDispatcher::ReadRes> tryRead) mutable {
return dispatcher_->getattr(ino, context.getObjectFetchContext())
.thenTry([this,
ser = std::move(ser),
tryRead = std::move(tryRead),
ino](const folly::Try<struct stat>& tryStat) mutable {
.thenTry([ser = std::move(ser), tryRead = std::move(tryRead)](
const folly::Try<struct stat>& tryStat) mutable {
if (tryRead.hasException()) {
READ3res res{
{{exceptionToNfsError(tryRead.exception()),
@ -579,26 +573,6 @@ ImmediateFuture<folly::Unit> Nfsd3ServerProcessor::read(
auto& read = tryRead.value();
auto length = read.data->computeChainDataLength();
if (UNLIKELY(
tryStat.hasValue() &&
length !=
folly::to_unsigned(tryStat.value().st_size))) {
XLOG(
ERR,
fmt::format(
"Mismatch in blob size and cached size for inode {} ! "
"actual content size: {} cached file size: {}.",
ino,
length,
tryStat.value().st_size));
// We only want to log to Scuba once per instance.
if (!this->metadataSizeMismatchLogged_.exchange(true)) {
this->structuredLogger_->logEvent(
MetadataSizeMismatch{"NFS", "read"});
}
}
if (UNLIKELY(tryStat.hasException())) {
XLOG(
WARN,

View File

@ -300,16 +300,4 @@ struct TooManyNfsClients {
void populate(DynamicEvent& /*event*/) const {}
};
struct MetadataSizeMismatch {
static constexpr const char* type = "metadata_size_mismatch";
std::string mount_protocol;
std::string method;
void populate(DynamicEvent& event) const {
event.addString("mount_protocol", mount_protocol);
event.addString("method", method);
}
};
} // namespace facebook::eden