Skip to content

Commit

Permalink
submodule/rdsn: fix pegasus compilation failure (apache#194)
Browse files Browse the repository at this point in the history
Former-commit-id: 416fb98a2f3590c9d3df6119ae7d429d855fcb6d [formerly 5098c9b]
Former-commit-id: 0f298ac5980d7a6354ff39c9b6a588929ddee465
  • Loading branch information
Wu Tao authored Oct 25, 2018
1 parent 8b2c3d8 commit fc70796
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion rdsn
Submodule rdsn updated 80 files
+1 −1 README.md
+66 −199 compile_thrift.py
+4 −4 doc/examples.layer1.h
+0 −52 include/dsn/c/api_layer1.h
+5 −5 include/dsn/cpp/message_utils.h
+3 −2 include/dsn/dist/failure_detector/failure_detector.h
+2 −2 include/dsn/dist/failure_detector_multimaster.h
+0 −1 include/dsn/service_api_cpp.h
+2 −0 include/dsn/tool-api/command_manager.h
+0 −8 include/dsn/tool-api/task.h
+1 −1 include/dsn/tool-api/task_worker.h
+2 −0 include/dsn/tool-api/timer_service.h
+2 −2 include/dsn/tool-api/uri_address.h
+54 −81 include/dsn/tool-api/zlocks.h
+0 −12 include/dsn/tool_api.h
+5 −4 include/dsn/utility/enum_helper.h
+4 −0 include/dsn/utility/ports.h
+0 −2 src/apps/skv/simple_kv.server.impl.cpp
+8 −9 src/core/core/command_manager.cpp
+0 −94 src/core/core/lock_checker.cpp
+0 −1 src/core/core/message_utils.cpp
+0 −1 src/core/core/partition_resolver_simple.cpp
+6 −6 src/core/core/partition_resolver_simple.h
+10 −24 src/core/core/rpc_engine.cpp
+5 −12 src/core/core/rpc_engine.h
+17 −160 src/core/core/service_api_c.cpp
+22 −35 src/core/core/service_engine.cpp
+15 −13 src/core/core/service_engine.h
+31 −1 src/core/core/task.cpp
+1 −4 src/core/core/task_queue.cpp
+20 −138 src/core/core/task_worker.cpp
+3 −31 src/core/core/tool_api.cpp
+3 −3 src/core/core/uri_address.cpp
+30 −37 src/core/core/zlock_provider.h
+171 −4 src/core/core/zlocks.cpp
+10 −8 src/core/tests/message_utils_test.cpp
+3 −12 src/core/tests/rpc.cpp
+26 −32 src/core/tests/service_api_c.cpp
+9 −10 src/core/tests/sim_lock.cpp
+28 −17 src/core/tools/common/asio_net_provider.cpp
+6 −12 src/core/tools/common/asio_net_provider.h
+14 −0 src/core/tools/common/lockp.std.cpp
+3 −1 src/core/tools/common/lockp.std.h
+14 −2 src/core/tools/common/native_aio_provider.linux.cpp
+3 −14 src/core/tools/common/native_aio_provider.linux.h
+0 −339 src/core/tools/common/native_aio_provider.win.cpp
+0 −70 src/core/tools/common/native_aio_provider.win.h
+0 −2 src/core/tools/common/profiler.cpp
+5 −4 src/core/tools/common/profiler_output.cpp
+3 −11 src/core/tools/common/providers.common.cpp
+17 −15 src/core/tools/common/simple_task_queue.cpp
+8 −12 src/core/tools/common/simple_task_queue.h
+7 −4 src/core/tools/simulator/simulator.cpp
+3 −1 src/core/tools/simulator/task_engine.sim.h
+0 −2 src/dist/failure_detector/failure_detector.cpp
+1 −1 src/dist/failure_detector_multimaster/failure_detector_multimaster.cpp
+1 −0 src/dist/nfs/nfs_client_impl.h
+2 −2 src/dist/replication/common/block_service_manager.cpp
+2 −2 src/dist/replication/common/block_service_manager.h
+1 −1 src/dist/replication/common/fs_manager.h
+0 −2 src/dist/replication/common/replication_common.h
+2 −0 src/dist/replication/global_checker/checker.cpp
+0 −2 src/dist/replication/lib/mutation_log.cpp
+2 −1 src/dist/replication/lib/mutation_log.h
+0 −2 src/dist/replication/lib/replica.h
+1 −0 src/dist/replication/lib/replica_context.h
+0 −2 src/dist/replication/lib/replica_init.cpp
+2 −4 src/dist/replication/lib/replica_stub.cpp
+0 −3 src/dist/replication/lib/replication_admission_controller.h
+1 −2 src/dist/replication/meta_server/distributed_lock_service_simple.h
+1 −3 src/dist/replication/meta_server/meta_backup_service.h
+1 −1 src/dist/replication/meta_server/meta_data.h
+1 −1 src/dist/replication/meta_server/meta_server_failure_detector.h
+2 −4 src/dist/replication/meta_server/meta_state_service_simple.h
+2 −2 src/dist/replication/meta_server/server_load_balancer.cpp
+3 −3 src/dist/replication/meta_server/server_load_balancer.h
+2 −1 src/dist/replication/test/meta_test/unit_test/update_configuration_test.cpp
+2 −2 src/dist/replication/test/simple_kv/case.h
+8 −8 src/dist/replication/test/simple_kv/simple_kv.server.impl.cpp
+2 −1 src/dist/replication/test/simple_kv/simple_kv.server.impl.h
6 changes: 3 additions & 3 deletions src/client_lib/pegasus_client_factory_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace client {

std::unordered_map<std::string, pegasus_client_factory_impl::app_to_client_map>
pegasus_client_factory_impl::_cluster_to_clients;
dsn::service::zlock *pegasus_client_factory_impl::_map_lock;
dsn::zlock *pegasus_client_factory_impl::_map_lock;

bool pegasus_client_factory_impl::initialize(const char *config_file)
{
Expand All @@ -29,7 +29,7 @@ bool pegasus_client_factory_impl::initialize(const char *config_file)
}
}
pegasus_client_impl::init_error();
_map_lock = new ::dsn::service::zlock();
_map_lock = new ::dsn::zlock();
return true;
}

Expand All @@ -45,7 +45,7 @@ pegasus_client *pegasus_client_factory_impl::get_client(const char *cluster_name
return nullptr;
}

::dsn::service::zauto_lock l(*_map_lock);
::dsn::zauto_lock l(*_map_lock);
auto it = _cluster_to_clients.find(cluster_name);
if (it == _cluster_to_clients.end()) {
it = _cluster_to_clients
Expand Down
2 changes: 1 addition & 1 deletion src/client_lib/pegasus_client_factory_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class pegasus_client_factory_impl
typedef std::unordered_map<std::string, pegasus_client_impl *> app_to_client_map;
typedef std::unordered_map<std::string, app_to_client_map> cluster_to_app_map;
static cluster_to_app_map _cluster_to_clients;
static ::dsn::service::zlock *_map_lock;
static ::dsn::zlock *_map_lock;
};
}
} // namespace
3 changes: 2 additions & 1 deletion src/client_lib/pegasus_client_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <string>
#include <pegasus/client.h>
#include <rrdb/rrdb.client.h>
#include <dsn/tool-api/zlocks.h>
#include "base/pegasus_key_schema.h"
#include "base/pegasus_utils.h"

Expand Down Expand Up @@ -262,7 +263,7 @@ class pegasus_client_impl : public pegasus_client
int32_t _p;

int64_t _context;
mutable ::dsn::service::zlock _lock;
mutable ::dsn::zlock _lock;
std::list<async_scan_next_callback_t> _queue;
volatile bool _rpc_started;

Expand Down
4 changes: 2 additions & 2 deletions src/client_lib/pegasus_scanner_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void pegasus_client_impl::pegasus_scanner_impl::async_next(async_scan_next_callb

bool pegasus_client_impl::pegasus_scanner_impl::safe_destructible() const
{
::dsn::service::zauto_lock l(_lock);
::dsn::zauto_lock l(_lock);
return _queue.empty();
}

Expand Down Expand Up @@ -270,7 +270,7 @@ void pegasus_client_impl::pegasus_scanner_impl::_split_reset()

pegasus_client_impl::pegasus_scanner_impl::~pegasus_scanner_impl()
{
dsn::service::zauto_lock l(_lock);
dsn::zauto_lock l(_lock);

dassert(!_rpc_started, "all scan-rpc should be completed here");
dassert(_queue.empty(), "queue should be empty");
Expand Down
6 changes: 3 additions & 3 deletions src/redis_protocol/proxy_lib/proxy_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ void proxy_stub::on_rpc_request(dsn::message_ex *request)
::dsn::rpc_address source = request->header->from_address;
std::shared_ptr<proxy_session> ps;
{
::dsn::service::zauto_read_lock l(_lock);
::dsn::zauto_read_lock l(_lock);
auto it = _sessions.find(source);
if (it != _sessions.end()) {
ps = it->second;
}
}
if (nullptr == ps) {
::dsn::service::zauto_write_lock l(_lock);
::dsn::zauto_write_lock l(_lock);
auto it = _sessions.find(source);
if (it != _sessions.end()) {
ps = it->second;
Expand All @@ -79,7 +79,7 @@ void proxy_stub::on_recv_remove_session_request(dsn::message_ex *request)

std::shared_ptr<proxy_session> proxy_stub::remove_session(dsn::rpc_address remote_address)
{
::dsn::service::zauto_write_lock l(_lock);
::dsn::zauto_write_lock l(_lock);
auto iter = _sessions.find(remote_address);
if (iter == _sessions.end()) {
dwarn("%s has been removed from proxy stub", remote_address.to_string());
Expand Down
4 changes: 2 additions & 2 deletions src/redis_protocol/proxy_lib/proxy_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include <dsn/service_api_cpp.h>
#include <dsn/cpp/zlocks.h>
#include <dsn/tool-api/zlocks.h>
#include <unordered_map>
#include <functional>

Expand Down Expand Up @@ -84,7 +84,7 @@ class proxy_stub : public ::dsn::serverlet<proxy_stub>
void on_rpc_request(dsn::message_ex *request);
void on_recv_remove_session_request(dsn::message_ex *);

::dsn::service::zrwlock_nr _lock;
::dsn::zrwlock_nr _lock;
std::unordered_map<::dsn::rpc_address, std::shared_ptr<proxy_session>> _sessions;
proxy_session::factory _factory;
::dsn::rpc_address _uri_address;
Expand Down
4 changes: 2 additions & 2 deletions src/redis_protocol/proxy_lib/redis_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,14 @@ bool redis_parser::parse(dsn::message_ex *msg)

void redis_parser::enqueue_pending_response(std::unique_ptr<message_entry> &&entry)
{
dsn::service::zauto_lock l(response_lock);
dsn::zauto_lock l(response_lock);
pending_response.emplace_back(std::move(entry));
}

void redis_parser::fetch_and_dequeue_messages(std::vector<dsn::message_ex *> &msgs,
bool only_ready_ones)
{
dsn::service::zauto_lock l(response_lock);
dsn::zauto_lock l(response_lock);
while (!pending_response.empty()) {
message_entry *entry = pending_response.front().get();
dsn::message_ex *r = entry->response.load(std::memory_order_acquire);
Expand Down
2 changes: 1 addition & 1 deletion src/redis_protocol/proxy_lib/redis_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class redis_parser : public proxy_session

private:
// queue for pipeline the response
dsn::service::zlock response_lock;
dsn::zlock response_lock;
std::deque<std::unique_ptr<message_entry>> pending_response;

// recieving message and parsing status
Expand Down
3 changes: 0 additions & 3 deletions src/server/test/pegasus_server_write_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ class pegasus_server_write_test : public pegasus_server_test_base
writes[i] = pegasus::create_remove_request(key);
}
auto cleanup = dsn::defer([=]() {
for (int i = 0; i < total_rpc_cnt; i++) {
writes[i]->release_ref();
}
delete[] writes;
});

Expand Down

0 comments on commit fc70796

Please sign in to comment.