This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new 0a63f0318 [tserver] log errors on invalid schemas
0a63f0318 is described below
commit 0a63f0318421e4ec58f79e3c185b496db8025d42
Author: Alexey Serbin <[email protected]>
AuthorDate: Mon Feb 9 22:42:54 2026 -0800
[tserver] log errors on invalid schemas
To help troubleshoot issues like KUDU-3723, it's useful to report on
invalid table and partition schemas sent by the catalog manager to
tablet servers. This patch adds corresponding logs, and wraps the
related rare conditions with EXPECT_FALSE().
This changelist doesn't contain any functional modifications.
Change-Id: I2b0d05106cb5c8e0acc8cacd34c9703dbc25b4b7
Reviewed-on: http://gerrit.cloudera.org:8080/23956
Tested-by: Kudu Jenkins
Reviewed-by: Gabriella Lotz <[email protected]>
Reviewed-by: Abhishek Chennaka <[email protected]>
---
src/kudu/tserver/tablet_service.cc | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/kudu/tserver/tablet_service.cc
b/src/kudu/tserver/tablet_service.cc
index 6e949fed5..d41d205fd 100644
--- a/src/kudu/tserver/tablet_service.cc
+++ b/src/kudu/tserver/tablet_service.cc
@@ -1204,7 +1204,7 @@ void TabletServiceAdminImpl::AlterSchema(const
AlterSchemaRequestPB* req,
// specified in the request.
Schema req_schema;
Status s = SchemaFromPB(req->schema(), &req_schema);
- if (!s.ok()) {
+ if (PREDICT_FALSE(!s.ok())) {
SetupErrorAndRespond(resp->mutable_error(), s,
TabletServerErrorPB::INVALID_SCHEMA, context);
return;
@@ -1483,19 +1483,25 @@ void TabletServiceAdminImpl::CreateTablet(const
CreateTabletRequestPB* req,
Schema schema;
Status s = SchemaFromPB(req->schema(), &schema);
DCHECK(schema.has_column_ids());
- if (!s.ok()) {
+ if (PREDICT_FALSE(!s.ok())) {
+ static constexpr const char* const kErrMsg = "invalid Schema";
SetupErrorAndRespond(resp->mutable_error(),
- Status::InvalidArgument("Invalid Schema."),
+ Status::InvalidArgument(kErrMsg),
TabletServerErrorPB::INVALID_SCHEMA, context);
+ KLOG_EVERY_N_SECS(ERROR, 60)
+ << Substitute("$0: $1", kErrMsg, s.ToString()) << THROTTLE_MSG;
return;
}
PartitionSchema partition_schema;
s = PartitionSchema::FromPB(req->partition_schema(), schema,
&partition_schema);
- if (!s.ok()) {
+ if (PREDICT_FALSE(!s.ok())) {
+ static constexpr const char* const kErrMsg = "invalid PartitionSchema";
SetupErrorAndRespond(resp->mutable_error(),
- Status::InvalidArgument("Invalid PartitionSchema."),
+ Status::InvalidArgument(kErrMsg),
TabletServerErrorPB::INVALID_SCHEMA, context);
+ KLOG_EVERY_N_SECS(ERROR, 60)
+ << Substitute("$0: $1", kErrMsg, s.ToString()) << THROTTLE_MSG;
return;
}