Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement logdev rollback #626

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ pipeline {
}

stage("Deploy Package") {
when { allOf {
branch "${STABLE_BRANCH}"
expression { "${BUILD_TYPE}" != 'coverage' }
expression { "${BUILD_TYPE}" != 'sanitize' }
Expand All @@ -78,14 +77,15 @@ pipeline {
}
}
stage("Image") {
when { branch "${STABLE_BRANCH}" }
steps {
withDockerRegistry([credentialsId: 'sds-sds', url: "https://${HUB_URL}"]) {
sh "docker push ${HUB_PATH}:${CONAN_CHANNEL}-${BUILD_TYPE}"
}
}
post {
success {
slackSend color: '#85B717', channel: '#sds-ci', message: "*${HUB_PATH}:${CONAN_CHANNEL}-${BUILD_TYPE}* has been uploaded to ECR."
slackSend color: '#85B717', channel: '#sds-ci', message: "*${HUB_PATH}:${SANITIZED_BRANCH}-${BUILD_TYPE}* has been uploaded to ECR."
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class HomestoreConan(ConanFile):
name = "homestore"
version = "3.7.6"
version = "3.8.0"

homepage = "https://github.corp.ebay.com/SDS/homestore"
description = "HomeStore"
Expand All @@ -28,7 +28,7 @@ class HomestoreConan(ConanFile):
'testing': 'epoll_mode',
'skip_testing': False,
'sisl:prerelease': True,
"pistache:with_ssl": True,
'pistache:with_ssl': True,
}


Expand Down
2 changes: 1 addition & 1 deletion locks/base.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"graph_lock": {
"nodes": {
"0": {
"ref": "homestore/3.7.6",
"ref": "homestore/3.8.0",
"requires": [
"1",
"2",
Expand Down
3 changes: 2 additions & 1 deletion locks/coverage_deps.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion locks/debug_deps.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion locks/release_deps.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locks/sanitize_deps.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"graph_lock": {
"nodes": {
"0": {
"ref": "homestore/3.7.6",
"ref": "homestore/3.8.0",
"options": "coverage=False\nfPIC=True\nsanitize=True\nshared=False\nskip_testing=False\ntesting=epoll_mode\nabseil:fPIC=True\nabseil:shared=False\nboost:addr2line_location=/usr/bin/addr2line\nboost:asio_no_deprecated=False\nboost:buildid=None\nboost:bzip2=True\nboost:debug_level=0\nboost:diagnostic_definitions=False\nboost:error_code_header_only=False\nboost:extra_b2_flags=None\nboost:fPIC=True\nboost:filesystem_no_deprecated=False\nboost:filesystem_version=None\nboost:header_only=False\nboost:i18n_backend=deprecated\nboost:i18n_backend_iconv=libc\nboost:i18n_backend_icu=False\nboost:layout=system\nboost:lzma=False\nboost:magic_autolink=False\nboost:multithreading=True\nboost:namespace=boost\nboost:namespace_alias=False\nboost:numa=True\nboost:pch=True\nboost:python_executable=None\nboost:python_version=None\nboost:segmented_stacks=False\nboost:shared=False\nboost:system_no_deprecated=False\nboost:system_use_utf8=False\nboost:visibility=hidden\nboost:with_stacktrace_backtrace=True\nboost:without_atomic=False\nboost:without_chrono=False\nboost:without_container=False\nboost:without_context=False\nboost:without_contract=False\nboost:without_coroutine=False\nboost:without_date_time=False\nboost:without_exception=False\nboost:without_fiber=False\nboost:without_filesystem=False\nboost:without_graph=False\nboost:without_graph_parallel=True\nboost:without_iostreams=False\nboost:without_json=False\nboost:without_locale=False\nboost:without_log=False\nboost:without_math=False\nboost:without_mpi=True\nboost:without_nowide=False\nboost:without_program_options=False\nboost:without_python=True\nboost:without_random=False\nboost:without_regex=False\nboost:without_serialization=False\nboost:without_stacktrace=False\nboost:without_system=False\nboost:without_test=False\nboost:without_thread=False\nboost:without_timer=False\nboost:without_type_erasure=False\nboost:without_wave=False\nboost:zlib=True\nboost:zstd=False\nbreakpad:fPIC=True\nbzip2:build_executable=True\nbzip2:fPIC=True\nbzip2:shared=False\nc-ares:fPIC=True\nc-ares:shared=False\nc-ares:tools=True\ncivetweb:fPIC=True\ncivetweb:shared=False\ncivetweb:ssl_dynamic_loading=False\ncivetweb:with_caching=True\ncivetweb:with_cgi=True\ncivetweb:with_cxx=True\ncivetweb:with_duktape=False\ncivetweb:with_ipv6=True\ncivetweb:with_lua=False\ncivetweb:with_server_stats=False\ncivetweb:with_ssl=True\ncivetweb:with_static_files=True\ncivetweb:with_third_party_output=False\ncivetweb:with_websockets=True\ncivetweb:with_zlib=False\ncpr:fPIC=True\ncpr:shared=False\ncpr:signal=True\ncpr:with_ssl=auto\ncxxopts:unicode=False\ndate:fPIC=True\ndate:header_only=False\ndate:shared=False\ndate:use_system_tz_db=False\ndate:use_tz_db_in_dot=False\ndouble-conversion:fPIC=True\ndouble-conversion:shared=False\ndpdk:fPIC=True\ndpdk:native_build=False\ndpdk:numa=False\ndpdk:shared=False\nfarmhash:fPIC=True\nfarmhash:no_builtin_expect=False\nfarmhash:shared=False\nfio:native_build=False\nflatbuffers:fPIC=True\nflatbuffers:header_only=False\nflatbuffers:shared=False\nfmt:fPIC=True\nfmt:header_only=False\nfmt:shared=False\nfmt:with_fmt_alias=False\nfmt:with_os_api=True\nfolly:fPIC=True\nfolly:shared=False\nfolly:use_sse4_2=False\ngflags:fPIC=True\ngflags:namespace=gflags\ngflags:nothreads=True\ngflags:shared=False\nglog:fPIC=True\nglog:shared=False\nglog:with_gflags=True\nglog:with_threads=True\ngrpc:codegen=True\ngrpc:cpp_plugin=True\ngrpc:csharp_ext=False\ngrpc:csharp_plugin=True\ngrpc:fPIC=True\ngrpc:node_plugin=True\ngrpc:objective_c_plugin=True\ngrpc:php_plugin=True\ngrpc:python_plugin=True\ngrpc:ruby_plugin=True\ngrpc:secure=False\ngrpc:shared=False\niomgr:coverage=False\niomgr:fPIC=True\niomgr:sanitize=False\niomgr:shared=False\niomgr:testing=epoll_mode\nisa-l:fPIC=True\nisa-l:shared=False\nlibbacktrace:fPIC=True\nlibbacktrace:shared=False\nlibcurl:fPIC=True\nlibcurl:shared=False\nlibcurl:with_brotli=False\nlibcurl:with_c_ares=False\nlibcurl:with_ca_bundle=auto\nlibcurl:with_ca_fallback=False\nlibcurl:with_ca_path=auto\nlibcurl:with_cookies=True\nlibcurl:with_crypto_auth=True\nlibcurl:with_dict=True\nlibcurl:with_docs=False\nlibcurl:with_file=True\nlibcurl:with_ftp=True\nlibcurl:with_gopher=True\nlibcurl:with_http=True\nlibcurl:with_imap=True\nlibcurl:with_ipv6=True\nlibcurl:with_largemaxwritesize=False\nlibcurl:with_ldap=False\nlibcurl:with_libgsasl=False\nlibcurl:with_libidn=False\nlibcurl:with_libpsl=False\nlibcurl:with_librtmp=False\nlibcurl:with_libssh2=False\nlibcurl:with_mqtt=True\nlibcurl:with_nghttp2=False\nlibcurl:with_ntlm=True\nlibcurl:with_ntlm_wb=True\nlibcurl:with_pop3=True\nlibcurl:with_proxy=True\nlibcurl:with_rtsp=True\nlibcurl:with_smb=True\nlibcurl:with_smtp=True\nlibcurl:with_ssl=openssl\nlibcurl:with_symbol_hiding=False\nlibcurl:with_telnet=True\nlibcurl:with_tftp=True\nlibcurl:with_threaded_resolver=True\nlibcurl:with_unix_sockets=True\nlibcurl:with_verbose_debug=True\nlibcurl:with_verbose_strings=True\nlibcurl:with_zlib=True\nlibcurl:with_zstd=False\nlibdwarf:fPIC=True\nlibdwarf:shared=False\nlibdwarf:with_dwarfgen=False\nlibelf:fPIC=True\nlibelf:shared=False\nlibevent:disable_threads=False\nlibevent:fPIC=True\nlibevent:shared=False\nlibevent:with_openssl=True\nlibiberty:fPIC=True\nlibsodium:PIE=False\nlibsodium:fPIC=True\nlibsodium:shared=False\nlibsodium:use_soname=True\nlibunwind:coredump=True\nlibunwind:fPIC=True\nlibunwind:minidebuginfo=True\nlibunwind:ptrace=True\nlibunwind:setjmp=True\nlibunwind:shared=False\nlibunwind:zlibdebuginfo=True\nliburing:fPIC=True\nliburing:shared=False\nlz4:fPIC=True\nlz4:shared=False\nopenssl:386=False\nopenssl:enable_weak_ssl_ciphers=False\nopenssl:fPIC=True\nopenssl:no_aria=False\nopenssl:no_asm=False\nopenssl:no_async=False\nopenssl:no_bf=False\nopenssl:no_blake2=False\nopenssl:no_camellia=False\nopenssl:no_cast=False\nopenssl:no_chacha=False\nopenssl:no_cms=False\nopenssl:no_comp=False\nopenssl:no_ct=False\nopenssl:no_deprecated=False\nopenssl:no_des=False\nopenssl:no_dgram=False\nopenssl:no_dh=False\nopenssl:no_dsa=False\nopenssl:no_dso=False\nopenssl:no_ec=False\nopenssl:no_ecdh=False\nopenssl:no_ecdsa=False\nopenssl:no_engine=False\nopenssl:no_filenames=False\nopenssl:no_gost=False\nopenssl:no_hmac=False\nopenssl:no_idea=False\nopenssl:no_md4=False\nopenssl:no_md5=False\nopenssl:no_mdc2=False\nopenssl:no_ocsp=False\nopenssl:no_pinshared=False\nopenssl:no_rc2=False\nopenssl:no_rfc3779=False\nopenssl:no_rmd160=False\nopenssl:no_rsa=False\nopenssl:no_seed=False\nopenssl:no_sha=False\nopenssl:no_sm2=False\nopenssl:no_sm3=False\nopenssl:no_sm4=False\nopenssl:no_sock=False\nopenssl:no_srp=False\nopenssl:no_srtp=False\nopenssl:no_sse2=False\nopenssl:no_ssl=False\nopenssl:no_ssl3=False\nopenssl:no_stdio=False\nopenssl:no_tests=False\nopenssl:no_threads=False\nopenssl:no_tls1=False\nopenssl:no_ts=False\nopenssl:no_whirlpool=False\nopenssl:openssldir=None\nopenssl:shared=False\npistache:fPIC=True\npistache:shared=False\npistache:with_ssl=True\nprometheus-cpp:fPIC=True\nprometheus-cpp:shared=False\nprometheus-cpp:with_compression=True\nprometheus-cpp:with_pull=True\nprometheus-cpp:with_push=True\nprotobuf:debug_suffix=True\nprotobuf:fPIC=True\nprotobuf:lite=False\nprotobuf:shared=False\nprotobuf:with_rtti=True\nprotobuf:with_zlib=True\nre2:fPIC=True\nre2:shared=False\nre2:with_icu=False\nsisl:coverage=False\nsisl:fPIC=True\nsisl:malloc_impl=libc\nsisl:prerelease=True\nsisl:sanitize=False\nsisl:shared=False\nsnappy:fPIC=True\nsnappy:shared=False\nsnappy:with_bmi2=auto\nsnappy:with_ssse3=auto\nspdk:fPIC=True\nspdk:native_build=True\nspdk:shared=False\nspdlog:fPIC=True\nspdlog:header_only=False\nspdlog:no_exceptions=False\nspdlog:shared=False\nspdlog:wchar_filenames=False\nspdlog:wchar_support=False\nuserspace-rcu:fPIC=True\nuserspace-rcu:model=generic\nuserspace-rcu:shared=False\nxz_utils:fPIC=True\nxz_utils:shared=False\nzlib:fPIC=True\nzlib:shared=False\nzmarok-semver:fPIC=True\nzmarok-semver:shared=False\nzstd:build_programs=True\nzstd:fPIC=True\nzstd:shared=False\nzstd:threading=True",
"requires": [
"1",
Expand Down
22 changes: 17 additions & 5 deletions src/homeblks/home_blks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ VolInterface* HomeBlks::init(const init_params& cfg, bool fake_reboot) {
if (thread_started) {
instance->m_init_thread_id = iomanager.iothread_self();
if (instance->is_safe_mode()) {
std::unique_lock< std::mutex > lk(instance->m_cv_mtx);
auto lk = std::unique_lock< std::mutex >{instance->m_cv_mtx};
/* we wait for gdb to attach in safe mode */
LOGINFO("Going to sleep. Waiting for user to send http command to wake up");
instance->m_cv_wakeup_init.wait(lk);
instance->m_cv_wakeup_init.wait(lk, [instance]() { return instance->woke_up; });
}
instance->init_devices();
}
Expand Down Expand Up @@ -186,7 +186,13 @@ HomeBlks::HomeBlks(const init_params& cfg) :
}
}

void HomeBlks::wakeup_init() { m_cv_wakeup_init.notify_one(); }
void HomeBlks::wakeup_init() {
if (is_safe_mode() && !woke_up) {
auto lk = std::scoped_lock< std::mutex >{m_cv_mtx};
woke_up = true;
}
m_cv_wakeup_init.notify_one();
}

void HomeBlks::attach_prepare_indx_cp(std::map< boost::uuids::uuid, indx_cp_ptr >* cur_icp_map,
std::map< boost::uuids::uuid, indx_cp_ptr >* new_icp_map, hs_cp* cur_hcp,
Expand Down Expand Up @@ -1071,7 +1077,7 @@ void HomeBlks::trigger_cp_init(uint32_t vol_mnt_cnt) {
m_rdy = true;
iomanager.run_on(m_init_thread_id, ([this](io_thread_addr_t addr) { this->init_done(); }));
{
std::unique_lock< std::mutex > lk{m_cv_mtx};
auto lk = std::scoped_lock< std::mutex >{m_cv_mtx};
m_init_finished = true;
m_cv_init_cmplt.notify_all();
}
Expand Down Expand Up @@ -1166,7 +1172,13 @@ nlohmann::json HomeBlks::dump_disk_metablks(const std::string& client) {

bool HomeBlks::verify_metablk_store() { return MetaBlkMgrSI()->verify_metablk_store(); }

bool HomeBlks::is_safe_mode() { return HB_DYNAMIC_CONFIG(general_config->boot_safe_mode); }
bool HomeBlks::is_safe_mode() {
{
auto lk = std::scoped_lock< std::mutex >(m_cv_mtx);
if (woke_up) return false;
}
return HB_DYNAMIC_CONFIG(general_config->boot_safe_mode);
}

void HomeBlks::list_snapshot(const VolumePtr&, std::vector< SnapshotPtr > snap_list) {}

Expand Down
3 changes: 2 additions & 1 deletion src/homeblks/home_blks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ class HomeBlks : public VolInterface, public HomeStore< BLKSTORE_BUFFER_TYPE > {
std::unique_ptr< HomeBlksHttpServer > m_hb_http_server;

std::condition_variable m_cv_init_cmplt; // wait for init to complete
std::condition_variable m_cv_wakeup_init; // wait for init to complete
std::condition_variable m_cv_wakeup_init; // wait for safe_mode to wakeup
bool woke_up {false}; // wait for safe_mode to wakeup
std::mutex m_cv_mtx;
bool m_rdy = false;

Expand Down
Loading
Loading