You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2016/07/07 18:33:30 UTC
[1/7] incubator-kudu git commit: Make the error message,
for Status::AlreadyPresent() on row insertion, consistent
Repository: incubator-kudu
Updated Branches:
refs/heads/master a8a2e1983 -> 0212b7ecd
Make the error message, for Status::AlreadyPresent() on row insertion, consistent
Change-Id: I2f8775452ec45056e256e008c6fb4567e10c64ee
Reviewed-on: http://gerrit.cloudera.org:8080/3584
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/abd4a13a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/abd4a13a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/abd4a13a
Branch: refs/heads/master
Commit: abd4a13acea00d6c98558b36673fe1a3a5298314
Parents: a8a2e19
Author: David Alves <da...@cloudera.com>
Authored: Wed Jul 6 18:32:27 2016 -0700
Committer: David Ribeiro Alves <dr...@apache.org>
Committed: Thu Jul 7 03:44:32 2016 +0000
----------------------------------------------------------------------
src/kudu/tablet/memrowset.cc | 2 +-
src/kudu/tablet/tablet-test.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/abd4a13a/src/kudu/tablet/memrowset.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/memrowset.cc b/src/kudu/tablet/memrowset.cc
index 8a51e24..57c599d 100644
--- a/src/kudu/tablet/memrowset.cc
+++ b/src/kudu/tablet/memrowset.cc
@@ -149,7 +149,7 @@ Status MemRowSet::Insert(Timestamp timestamp,
// row is deleted.
MRSRow ms_row(this, mutation.current_mutable_value());
if (!ms_row.IsGhost()) {
- return Status::AlreadyPresent("entry already present in memrowset");
+ return Status::AlreadyPresent("key already present");
}
// Insert a "reinsert" mutation.
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/abd4a13a/src/kudu/tablet/tablet-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet-test.cc b/src/kudu/tablet/tablet-test.cc
index 6d33332..cb53ccb 100644
--- a/src/kudu/tablet/tablet-test.cc
+++ b/src/kudu/tablet/tablet-test.cc
@@ -203,7 +203,7 @@ TYPED_TEST(TestTablet, TestInsertDuplicateKey) {
// Insert again, should fail!
Status s = this->InsertTestRow(&writer, 12345, 0);
- ASSERT_STR_CONTAINS(s.ToString(), "entry already present in memrowset");
+ ASSERT_STR_CONTAINS(s.ToString(), "key already present");
ASSERT_EQ(1, this->TabletCount());
[6/7] incubator-kudu git commit: master: only use tablet reports to
notify master of altered tablets
Posted by ad...@apache.org.
master: only use tablet reports to notify master of altered tablets
One or more alter table operations are not considered finished until the
master is sure that all altered tablets have the newest schema version.
Today the master is notified of these schema version changes via tablet
report or via response to the AlterSchema() RPC, whichever comes first.
Notification via AlterSchema() RPC response, however, is unsafe in a world
with a single leader election lock, because taking the lock in an RPC
response can lead to deadlocks.
To avoid this, let's use tablet reports as the sole notification channel.
The completion of an AlterSchema() transaction now marks the tablet as
dirty; otherwise, there's no knowing exactly when the master would see the
altered tablet in a tablet report.
This notification change does not perfectly preserve existing semantics. For
example, if AlterSchema() had returned TABLET_NOT_FOUND, the old code would
make a "fake" call to CatalogManager::HandleTabletSchemaVersionReport() with
the new schema version, potentially unblocking clients who are waiting on
the alter table operation to complete. The new code can't do this; if tablet
reports are the only notification mechanism, a tablet that isn't found will
never report in. This can lead to client timeouts, though I'm unsure as to
whether this is a bad thing or not.
There are no new tests, but without the AlterSchema() change, many existing
tests failed with timeouts in client-issued alter table operations.
Change-Id: I09ff1560d0bd5cecefb08684ecf5c2c992d69d46
Reviewed-on: http://gerrit.cloudera.org:8080/3580
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/fb41e96d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/fb41e96d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/fb41e96d
Branch: refs/heads/master
Commit: fb41e96d2405337696f76b5af532bd2770f839ad
Parents: b130c5a
Author: Adar Dembo <ad...@cloudera.com>
Authored: Wed Jul 6 15:01:06 2016 -0700
Committer: Adar Dembo <ad...@cloudera.com>
Committed: Thu Jul 7 18:32:40 2016 +0000
----------------------------------------------------------------------
src/kudu/master/catalog_manager.cc | 6 +-----
src/kudu/tablet/tablet_peer.h | 10 ++++++++--
src/kudu/tablet/transactions/alter_schema_transaction.cc | 4 ++++
3 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/fb41e96d/src/kudu/master/catalog_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index 0c4bacc..1073a83 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -2313,9 +2313,7 @@ class AsyncAlterTable : public RetryingTSRpcTask {
VLOG(1) << "TS " << permanent_uuid() << ": alter complete on tablet " << tablet_->ToString();
}
- if (state() == kStateComplete) {
- master_->catalog_manager()->HandleTabletSchemaVersionReport(tablet_.get(), schema_version_);
- } else {
+ if (state() != kStateComplete) {
VLOG(1) << "Still waiting for other tablets to finish ALTER";
}
}
@@ -2329,7 +2327,6 @@ class AsyncAlterTable : public RetryingTSRpcTask {
req.set_new_table_name(l.data().pb.name());
req.set_schema_version(l.data().pb.version());
req.mutable_schema()->CopyFrom(l.data().pb.schema());
- schema_version_ = l.data().pb.version();
l.Unlock();
@@ -2341,7 +2338,6 @@ class AsyncAlterTable : public RetryingTSRpcTask {
return true;
}
- uint32_t schema_version_;
scoped_refptr<TabletInfo> tablet_;
tserver::AlterSchemaResponsePB resp_;
};
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/fb41e96d/src/kudu/tablet/tablet_peer.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_peer.h b/src/kudu/tablet/tablet_peer.h
index 20f03e3..e926f79 100644
--- a/src/kudu/tablet/tablet_peer.h
+++ b/src/kudu/tablet/tablet_peer.h
@@ -252,6 +252,11 @@ class TabletPeer : public RefCountedThreadSafe<TabletPeer>,
return meta_;
}
+ // Marks the tablet as dirty so that it's included in the next heartbeat.
+ void MarkTabletDirty(const std::string& reason) {
+ mark_dirty_clbk_.Run(reason);
+ }
+
private:
friend class RefCountedThreadSafe<TabletPeer>;
friend class TabletPeerTest;
@@ -316,8 +321,9 @@ class TabletPeer : public RefCountedThreadSafe<TabletPeer>,
scoped_refptr<log::LogAnchorRegistry> log_anchor_registry_;
// Function to mark this TabletPeer's tablet as dirty in the TSTabletManager.
- // This function must be called any time the cluster membership or cluster
- // leadership changes.
+ //
+ // Must be called whenever cluster membership or leadership changes, or when
+ // the tablet's schema changes.
Callback<void(const std::string& reason)> mark_dirty_clbk_;
// List of maintenance operations for the tablet that need information that only the peer
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/fb41e96d/src/kudu/tablet/transactions/alter_schema_transaction.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/transactions/alter_schema_transaction.cc b/src/kudu/tablet/transactions/alter_schema_transaction.cc
index 4c81530..4ee5f0f 100644
--- a/src/kudu/tablet/transactions/alter_schema_transaction.cc
+++ b/src/kudu/tablet/transactions/alter_schema_transaction.cc
@@ -112,6 +112,10 @@ Status AlterSchemaTransaction::Apply(gscoped_ptr<CommitMsg>* commit_msg) {
->SetSchemaForNextLogSegment(*DCHECK_NOTNULL(state_->schema()),
state_->schema_version());
+ // Altered tablets should be included in the next tserver heartbeat so that
+ // clients waiting on IsAlterTableDone() are unblocked promptly.
+ state_->tablet_peer()->MarkTabletDirty("Alter schema finished");
+
commit_msg->reset(new CommitMsg());
(*commit_msg)->set_op_type(ALTER_SCHEMA_OP);
return Status::OK();
[7/7] incubator-kudu git commit: master: handle RPC responses on
reactor threads
Posted by ad...@apache.org.
master: handle RPC responses on reactor threads
The introduction of the election rwlock requires that the handling of RPC
responses move off of the singleton thread pool used for invoking the
election callback, otherwise waiting on outstanding RPCs could lead to a
deadlock. Rather than introduce a new thread pool, I observed that none of
the responses take a lock or perform IO, so we can simplify the code a bit
by operating directly on the reactor threads.
There is one exception to the above statement: retried RPCs invoke Run() on
the reactor thread, and Run() can (theoretically) block on DNS resolution.
This has always been the case, though, so maybe we don't care?
Change-Id: I1af5a77ffa66fcc39f71243529a40aae2b542971
Reviewed-on: http://gerrit.cloudera.org:8080/3583
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/0212b7ec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/0212b7ec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/0212b7ec
Branch: refs/heads/master
Commit: 0212b7ecd59e1ae0054cfd6d227dbf7d8e8028f2
Parents: fb41e96
Author: Adar Dembo <ad...@cloudera.com>
Authored: Wed Jul 6 18:36:22 2016 -0700
Committer: Adar Dembo <ad...@cloudera.com>
Committed: Thu Jul 7 18:32:45 2016 +0000
----------------------------------------------------------------------
src/kudu/master/catalog_manager.cc | 45 ++++++++++-----------------------
src/kudu/master/catalog_manager.h | 5 ++--
2 files changed, 16 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0212b7ec/src/kudu/master/catalog_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index 1073a83..819b3a3 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -536,7 +536,7 @@ CatalogManager::CatalogManager(Master *master)
// (to correctly serialize invocations of ElectedAsLeaderCb upon
// closely timed consecutive elections).
.set_max_threads(1)
- .Build(&worker_pool_));
+ .Build(&leader_election_pool_));
}
CatalogManager::~CatalogManager() {
@@ -576,7 +576,7 @@ Status CatalogManager::Init(bool is_first_run) {
}
Status CatalogManager::ElectedAsLeaderCb() {
- return worker_pool_->SubmitClosure(
+ return leader_election_pool_->SubmitClosure(
Bind(&CatalogManager::VisitTablesAndTabletsTask, Unretained(this)));
}
@@ -736,7 +736,7 @@ void CatalogManager::Shutdown() {
//
// Must be done before shutting down the catalog, otherwise its tablet peer
// may be destroyed while still in use by a table visitor.
- worker_pool_->Shutdown();
+ leader_election_pool_->Shutdown();
// Shut down the underlying storage for tables and tablets.
if (sys_catalog_) {
@@ -1855,11 +1855,9 @@ class PickLeaderReplica : public TSPicker {
class RetryingTSRpcTask : public MonitoredTask {
public:
RetryingTSRpcTask(Master *master,
- ThreadPool* callback_pool,
gscoped_ptr<TSPicker> replica_picker,
const scoped_refptr<TableInfo>& table)
: master_(master),
- callback_pool_(callback_pool),
replica_picker_(std::move(replica_picker)),
table_(table),
start_ts_(MonoTime::Now(MonoTime::FINE)),
@@ -1915,6 +1913,8 @@ class RetryingTSRpcTask : public MonitoredTask {
// be called to mutate the state_ variable. If retry is desired, then
// no state change is made. Retries will automatically be attempted as long
// as the state is kStateRunning and deadline_ has not yet passed.
+ //
+ // Runs on the reactor thread, so must not block or perform any IO.
virtual void HandleResponse(int attempt) = 0;
// Return the id of the tablet that is the subject of the async request.
@@ -1941,18 +1941,9 @@ class RetryingTSRpcTask : public MonitoredTask {
}
// Callback meant to be invoked from asynchronous RPC service proxy calls.
+ //
+ // Runs on a reactor thread, so should not block or do any IO.
void RpcCallback() {
- // Defer the actual work of the callback off of the reactor thread.
- // This is necessary because our callbacks often do synchronous writes to
- // the catalog table, and we can't do synchronous IO on the reactor.
- CHECK_OK(callback_pool_->SubmitClosure(
- Bind(&RetryingTSRpcTask::DoRpcCallback,
- Unretained(this))));
- }
-
- // Handle the actual work of the RPC callback. This is run on the master's worker
- // pool, rather than a reactor thread, so it may do blocking IO operations.
- void DoRpcCallback() {
if (!rpc_.status().ok()) {
LOG(WARNING) << "TS " << target_ts_desc_->permanent_uuid() << ": "
<< type_name() << " RPC failed for tablet "
@@ -1970,7 +1961,6 @@ class RetryingTSRpcTask : public MonitoredTask {
}
Master * const master_;
- ThreadPool* const callback_pool_;
const gscoped_ptr<TSPicker> replica_picker_;
const scoped_refptr<TableInfo> table_;
@@ -2086,11 +2076,9 @@ class RetryingTSRpcTask : public MonitoredTask {
class RetrySpecificTSRpcTask : public RetryingTSRpcTask {
public:
RetrySpecificTSRpcTask(Master* master,
- ThreadPool* callback_pool,
const string& permanent_uuid,
const scoped_refptr<TableInfo>& table)
: RetryingTSRpcTask(master,
- callback_pool,
gscoped_ptr<TSPicker>(new PickSpecificUUID(permanent_uuid)),
table),
permanent_uuid_(permanent_uuid) {
@@ -2108,11 +2096,10 @@ class AsyncCreateReplica : public RetrySpecificTSRpcTask {
// The tablet lock must be acquired for reading before making this call.
AsyncCreateReplica(Master *master,
- ThreadPool *callback_pool,
const string& permanent_uuid,
const scoped_refptr<TabletInfo>& tablet,
const TabletMetadataLock& tablet_lock)
- : RetrySpecificTSRpcTask(master, callback_pool, permanent_uuid, tablet->table().get()),
+ : RetrySpecificTSRpcTask(master, permanent_uuid, tablet->table().get()),
tablet_id_(tablet->tablet_id()) {
deadline_ = start_ts_;
deadline_.AddDelta(MonoDelta::FromMilliseconds(FLAGS_tablet_creation_timeout_ms));
@@ -2175,12 +2162,12 @@ class AsyncCreateReplica : public RetrySpecificTSRpcTask {
class AsyncDeleteReplica : public RetrySpecificTSRpcTask {
public:
AsyncDeleteReplica(
- Master* master, ThreadPool* callback_pool, const string& permanent_uuid,
+ Master* master, const string& permanent_uuid,
const scoped_refptr<TableInfo>& table, std::string tablet_id,
TabletDataState delete_type,
boost::optional<int64_t> cas_config_opid_index_less_or_equal,
string reason)
- : RetrySpecificTSRpcTask(master, callback_pool, permanent_uuid, table),
+ : RetrySpecificTSRpcTask(master, permanent_uuid, table),
tablet_id_(std::move(tablet_id)),
delete_type_(delete_type),
cas_config_opid_index_less_or_equal_(
@@ -2269,10 +2256,8 @@ class AsyncDeleteReplica : public RetrySpecificTSRpcTask {
class AsyncAlterTable : public RetryingTSRpcTask {
public:
AsyncAlterTable(Master *master,
- ThreadPool* callback_pool,
const scoped_refptr<TabletInfo>& tablet)
: RetryingTSRpcTask(master,
- callback_pool,
gscoped_ptr<TSPicker>(new PickLeaderReplica(tablet)),
tablet->table().get()),
tablet_(tablet) {
@@ -2368,11 +2353,9 @@ bool SelectRandomTSForReplica(const TSDescriptorVector& ts_descs,
class AsyncAddServerTask : public RetryingTSRpcTask {
public:
AsyncAddServerTask(Master *master,
- ThreadPool* callback_pool,
const scoped_refptr<TabletInfo>& tablet,
const ConsensusStatePB& cstate)
: RetryingTSRpcTask(master,
- callback_pool,
gscoped_ptr<TSPicker>(new PickLeaderReplica(tablet)),
tablet->table()),
tablet_(tablet),
@@ -2496,7 +2479,7 @@ void CatalogManager::SendAlterTableRequest(const scoped_refptr<TableInfo>& table
}
void CatalogManager::SendAlterTabletRequest(const scoped_refptr<TabletInfo>& tablet) {
- auto call = new AsyncAlterTable(master_, worker_pool_.get(), tablet);
+ auto call = new AsyncAlterTable(master_, tablet);
tablet->table()->AddTask(call);
WARN_NOT_OK(call->Run(), "Failed to send alter table request");
}
@@ -2546,7 +2529,7 @@ void CatalogManager::SendDeleteReplicaRequest(
TabletDataState_Name(delete_type),
reason);
AsyncDeleteReplica* call =
- new AsyncDeleteReplica(master_, worker_pool_.get(), ts_uuid, table,
+ new AsyncDeleteReplica(master_, ts_uuid, table,
tablet_id, delete_type, cas_config_opid_index_less_or_equal,
reason);
if (table != nullptr) {
@@ -2561,7 +2544,7 @@ void CatalogManager::SendDeleteReplicaRequest(
void CatalogManager::SendAddServerRequest(const scoped_refptr<TabletInfo>& tablet,
const ConsensusStatePB& cstate) {
- auto task = new AsyncAddServerTask(master_, worker_pool_.get(), tablet, cstate);
+ auto task = new AsyncAddServerTask(master_, tablet, cstate);
tablet->table()->AddTask(task);
WARN_NOT_OK(task->Run(), "Failed to send new AddServer request");
@@ -2851,7 +2834,7 @@ void CatalogManager::SendCreateTabletRequest(const scoped_refptr<TabletInfo>& ta
tablet_lock.data().pb.committed_consensus_state().config();
tablet->set_last_create_tablet_time(MonoTime::Now(MonoTime::FINE));
for (const RaftPeerPB& peer : config.peers()) {
- AsyncCreateReplica* task = new AsyncCreateReplica(master_, worker_pool_.get(),
+ AsyncCreateReplica* task = new AsyncCreateReplica(master_,
peer.permanent_uuid(),
tablet, tablet_lock);
tablet->table()->AddTask(task);
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0212b7ec/src/kudu/master/catalog_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.h b/src/kudu/master/catalog_manager.h
index 75d6d8e..bc2e8e1 100644
--- a/src/kudu/master/catalog_manager.h
+++ b/src/kudu/master/catalog_manager.h
@@ -613,9 +613,8 @@ class CatalogManager : public tserver::TabletPeerLookupIf {
mutable simple_spinlock state_lock_;
State state_;
- // Used to defer work from reactor threads onto a thread where
- // blocking behavior is permissible.
- gscoped_ptr<ThreadPool> worker_pool_;
+ // Singleton pool that serializes invocations of ElectedAsLeaderCb().
+ gscoped_ptr<ThreadPool> leader_election_pool_;
// This field is updated when a node becomes leader master,
// waits for all outstanding uncommitted metadata (table and tablet metadata)
[3/7] incubator-kudu git commit: Add a way to include request ids in
log-dump
Posted by ad...@apache.org.
Add a way to include request ids in log-dump
This adds a way to output the request ids, if they exist, in log-dump.cc.
This is helpful when debugging as it allows to see which writes the
request ids get associated with.
Change-Id: I0ec824461d9753ab3726d4a06156e32d5515a12a
Reviewed-on: http://gerrit.cloudera.org:8080/3570
Reviewed-by: Todd Lipcon <to...@apache.org>
Tested-by: Kudu Jenkins
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/998414ca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/998414ca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/998414ca
Branch: refs/heads/master
Commit: 998414caa2bc09df40d963a6112ad9c826010176
Parents: 070ea6b
Author: David Alves <da...@cloudera.com>
Authored: Mon Jul 4 14:58:53 2016 -0700
Committer: David Ribeiro Alves <dr...@apache.org>
Committed: Thu Jul 7 04:21:36 2016 +0000
----------------------------------------------------------------------
src/kudu/consensus/log-dump.cc | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/998414ca/src/kudu/consensus/log-dump.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log-dump.cc b/src/kudu/consensus/log-dump.cc
index e26d778..8bab8fc 100644
--- a/src/kudu/consensus/log-dump.cc
+++ b/src/kudu/consensus/log-dump.cc
@@ -28,6 +28,7 @@
#include "kudu/consensus/log_reader.h"
#include "kudu/gutil/stl_util.h"
#include "kudu/gutil/strings/numbers.h"
+#include "kudu/rpc/rpc_header.pb.h"
#include "kudu/util/env.h"
#include "kudu/util/flags.h"
#include "kudu/util/logging.h"
@@ -104,7 +105,8 @@ void PrintIdOnly(const LogEntryPB& entry) {
Status PrintDecodedWriteRequestPB(const string& indent,
const Schema& tablet_schema,
- const WriteRequestPB& write) {
+ const WriteRequestPB& write,
+ const rpc::RequestIdPB* request_id) {
Schema request_schema;
RETURN_NOT_OK(SchemaFromPB(write.schema(), &request_schema));
@@ -114,6 +116,8 @@ Status PrintDecodedWriteRequestPB(const string& indent,
RETURN_NOT_OK(dec.DecodeOperations(&ops));
cout << indent << "Tablet: " << write.tablet_id() << endl;
+ cout << indent << "RequestId: "
+ << (request_id ? request_id->ShortDebugString() : "None") << endl;
cout << indent << "Consistency: "
<< ExternalConsistencyMode_Name(write.external_consistency_mode()) << endl;
if (write.has_propagated_timestamp()) {
@@ -139,7 +143,11 @@ Status PrintDecoded(const LogEntryPB& entry, const Schema& tablet_schema) {
const ReplicateMsg& replicate = entry.replicate();
if (replicate.op_type() == consensus::WRITE_OP) {
- RETURN_NOT_OK(PrintDecodedWriteRequestPB(indent, tablet_schema, replicate.write_request()));
+ RETURN_NOT_OK(PrintDecodedWriteRequestPB(
+ indent,
+ tablet_schema,
+ replicate.write_request(),
+ replicate.has_request_id() ? &replicate.request_id() : nullptr));
} else {
cout << indent << replicate.ShortDebugString() << endl;
}
[2/7] incubator-kudu git commit: Increase the timeout for
RaftConsensusItest::InsertWithCrashyNodes
Posted by ad...@apache.org.
Increase the timeout for RaftConsensusItest::InsertWithCrashyNodes
This test is failing on jenkins with timeouts, this just ups the timeout.
Change-Id: I9c2f46c72b23aded751bc4669fe90064d5116520
Reviewed-on: http://gerrit.cloudera.org:8080/3585
Reviewed-by: Todd Lipcon <to...@apache.org>
Tested-by: Kudu Jenkins
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/070ea6b9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/070ea6b9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/070ea6b9
Branch: refs/heads/master
Commit: 070ea6b9d6b3325d6b4fbda1c58d26376a0bbefd
Parents: abd4a13
Author: David Alves <da...@cloudera.com>
Authored: Wed Jul 6 20:07:25 2016 -0700
Committer: David Ribeiro Alves <dr...@apache.org>
Committed: Thu Jul 7 04:21:19 2016 +0000
----------------------------------------------------------------------
src/kudu/integration-tests/raft_consensus-itest.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/070ea6b9/src/kudu/integration-tests/raft_consensus-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/raft_consensus-itest.cc b/src/kudu/integration-tests/raft_consensus-itest.cc
index 5fd146a..fbb7577 100644
--- a/src/kudu/integration-tests/raft_consensus-itest.cc
+++ b/src/kudu/integration-tests/raft_consensus-itest.cc
@@ -856,7 +856,7 @@ TEST_F(RaftConsensusITest, InsertWithCrashyNodes) {
TestWorkload workload(cluster_.get());
workload.set_num_replicas(FLAGS_num_replicas);
workload.set_timeout_allowed(true);
- workload.set_write_timeout_millis(1000);
+ workload.set_write_timeout_millis(10000);
workload.set_num_write_threads(10);
workload.set_write_batch_size(1);
workload.Setup();
[5/7] incubator-kudu git commit: [java-client] Fix a hang in
TabletClient
Posted by ad...@apache.org.
[java-client] Fix a hang in TabletClient
TabletClient#sendRpc has been changing a lot lately, and it's finicky.
In this case we weren't handling RPCs that we needed to retry when the
connection had already been closed before we even tried to encode the
RPC. I've only been able to reproduce this on the cluster with really
slow inserts.
Change-Id: I5f92a2f9464f245182a59178f2eab8a88422864c
Reviewed-on: http://gerrit.cloudera.org:8080/3586
Reviewed-by: Dan Burkert <da...@cloudera.com>
Tested-by: Kudu Jenkins
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/b130c5ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/b130c5ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/b130c5ad
Branch: refs/heads/master
Commit: b130c5ad47d0dd84b1deb3c7551a62468360bdb1
Parents: dd341b7
Author: Jean-Daniel Cryans <jd...@apache.org>
Authored: Wed Jul 6 20:55:27 2016 -0700
Committer: Jean-Daniel Cryans <jd...@apache.org>
Committed: Thu Jul 7 18:16:02 2016 +0000
----------------------------------------------------------------------
.../kudu-client/src/main/java/org/kududb/client/TabletClient.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/b130c5ad/java/kudu-client/src/main/java/org/kududb/client/TabletClient.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/kududb/client/TabletClient.java b/java/kudu-client/src/main/java/org/kududb/client/TabletClient.java
index 4d664a9..d3ecf8f 100644
--- a/java/kudu-client/src/main/java/org/kududb/client/TabletClient.java
+++ b/java/kudu-client/src/main/java/org/kududb/client/TabletClient.java
@@ -187,7 +187,8 @@ public class TabletClient extends ReplayingDecoder<VoidEnum> {
// cleanup() already took care of calling failOrRetryRpc() for us. If it did, the entry we
// added in rpcs_inflight will be missing. If not, we have to call failOrRetryRpc()
// ourselves after this synchronized block.
- if (encodedRpcAndId != null && rpcs_inflight.containsKey(encodedRpcAndId.getSecond())) {
+ // `encodedRpcAndId` is null iff `chan` is null.
+ if (encodedRpcAndId == null || rpcs_inflight.containsKey(encodedRpcAndId.getSecond())) {
failRpc = true;
}
} else {
[4/7] incubator-kudu git commit: Revert "Add a way to include request
ids in log-dump"
Posted by ad...@apache.org.
Revert "Add a way to include request ids in log-dump"
This reverts commit 998414caa2bc09df40d963a6112ad9c826010176.
This went in out-of-order, ReplicateMsg doesn't have a RequestIdPB field yet.
Change-Id: I9ea031027aeb8587b112de18b8b3c8dcd16da54a
Reviewed-on: http://gerrit.cloudera.org:8080/3587
Tested-by: Kudu Jenkins
Reviewed-by: David Ribeiro Alves <dr...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/dd341b7e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/dd341b7e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/dd341b7e
Branch: refs/heads/master
Commit: dd341b7ee8fac06033d9b34f5ba594c3bfca74e7
Parents: 998414c
Author: David Ribeiro Alves <dr...@apache.org>
Authored: Thu Jul 7 05:05:34 2016 +0000
Committer: David Ribeiro Alves <dr...@apache.org>
Committed: Thu Jul 7 05:24:36 2016 +0000
----------------------------------------------------------------------
src/kudu/consensus/log-dump.cc | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/dd341b7e/src/kudu/consensus/log-dump.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log-dump.cc b/src/kudu/consensus/log-dump.cc
index 8bab8fc..e26d778 100644
--- a/src/kudu/consensus/log-dump.cc
+++ b/src/kudu/consensus/log-dump.cc
@@ -28,7 +28,6 @@
#include "kudu/consensus/log_reader.h"
#include "kudu/gutil/stl_util.h"
#include "kudu/gutil/strings/numbers.h"
-#include "kudu/rpc/rpc_header.pb.h"
#include "kudu/util/env.h"
#include "kudu/util/flags.h"
#include "kudu/util/logging.h"
@@ -105,8 +104,7 @@ void PrintIdOnly(const LogEntryPB& entry) {
Status PrintDecodedWriteRequestPB(const string& indent,
const Schema& tablet_schema,
- const WriteRequestPB& write,
- const rpc::RequestIdPB* request_id) {
+ const WriteRequestPB& write) {
Schema request_schema;
RETURN_NOT_OK(SchemaFromPB(write.schema(), &request_schema));
@@ -116,8 +114,6 @@ Status PrintDecodedWriteRequestPB(const string& indent,
RETURN_NOT_OK(dec.DecodeOperations(&ops));
cout << indent << "Tablet: " << write.tablet_id() << endl;
- cout << indent << "RequestId: "
- << (request_id ? request_id->ShortDebugString() : "None") << endl;
cout << indent << "Consistency: "
<< ExternalConsistencyMode_Name(write.external_consistency_mode()) << endl;
if (write.has_propagated_timestamp()) {
@@ -143,11 +139,7 @@ Status PrintDecoded(const LogEntryPB& entry, const Schema& tablet_schema) {
const ReplicateMsg& replicate = entry.replicate();
if (replicate.op_type() == consensus::WRITE_OP) {
- RETURN_NOT_OK(PrintDecodedWriteRequestPB(
- indent,
- tablet_schema,
- replicate.write_request(),
- replicate.has_request_id() ? &replicate.request_id() : nullptr));
+ RETURN_NOT_OK(PrintDecodedWriteRequestPB(indent, tablet_schema, replicate.write_request()));
} else {
cout << indent << replicate.ShortDebugString() << endl;
}