Skip to content

Commit

Permalink
Handle overflow error from license manager (vesoft-inc#2590)
Browse files Browse the repository at this point in the history
* Handle overflow error in HB

* Fix resource limit

* Remove legacy license

* Remove legacy license and fix hb logic

* Modify log

* Remove license from test cluster set up

---------

Co-authored-by: Sophie <[email protected]>
  • Loading branch information
Aiee and Sophie-Xie authored Apr 12, 2023
1 parent 38a7e66 commit de4fb65
Show file tree
Hide file tree
Showing 65 changed files with 167 additions and 2,298 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/decrypt_secret.sh

This file was deleted.

4 changes: 0 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,6 @@ jobs:
run: |
[ -d build/ ] && rm -rf build/* || mkdir -p build
make init -C tests
- name: Decrypt License
run: sh ./.github/workflows/decrypt_secret.sh
env:
SECRET_PASSPHRASE: ${{ secrets.LICENSE_PASSWORD }}
- name: CMake
id: cmake
run: |
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ jobs:
run: |
[ -d build/ ] && rm -rf build/* || mkdir -p build
make init -C tests
- name: Decrypt License
run: sh ./.github/workflows/decrypt_secret.sh
env:
SECRET_PASSPHRASE: ${{ secrets.LICENSE_PASSWORD }}
- name: CMake
id: cmake
run: |
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,6 @@ jobs:
run: |
[ -d build/ ] && rm -rf build/* || mkdir -p build
make init -C tests
- name: Decrypt License
run: sh ./.github/workflows/decrypt_secret.sh
env:
SECRET_PASSPHRASE: ${{ secrets.LICENSE_PASSWORD }}
- name: CMake
id: cmake
run: |
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,3 @@ venv/
#ctags
.tags
/.vs
#license
tests/secrets/nebula.license
1 change: 0 additions & 1 deletion conf/nebula-metad.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
--daemonize=true
# The file to host the process id
--pid_file=pids/nebula-metad.pid
--license_path=share/resources/nebula.license

########## enterprise license ##########
# The address of license manager in format of ip:port
Expand Down
3 changes: 0 additions & 3 deletions conf/nebula-metad.conf.production
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
# The file to host the process id
--pid_file=pids/nebula-metad.pid

# TODO(Aiee): remove this option
--license_path=share/resources/nebula.license

########## enterprise license ##########
# The address of license manager in format of ip:port
--license_manager_url=license.vesoft-inc.com:9119
Expand Down
1 change: 0 additions & 1 deletion conf/nebula-standalone.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
--daemonize=true
# The file to host the process id
--pid_file=pids/nebula-standalone.pid
--license_path=share/resources/nebula.license
# Whether to enable optimizer
--enable_optimizer=true
# The default charset when a space is created
Expand Down
1 change: 0 additions & 1 deletion conf/nebula-standalone.conf.production
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
--daemonize=true
# The file to host the process id
--pid_file=pids/nebula-standalone.pid
--license_path=share/resources/nebula.license
# Whether to enable optimizer
--enable_optimizer=true
# The default charset when a space is created
Expand Down
8 changes: 4 additions & 4 deletions src/clients/meta/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,17 +1329,17 @@ Status MetaClient::handleResponse(const RESP& resp) {
LOG(ERROR) << "[License Manager] The number of nodes exceeds the limit, shutting down the "
"current node!";
std::raise(SIGTERM);
return Status::Error(" Nodes number exceeds the limit!");
return Status::Error("The number of nodes exceeds the limit!");
}
case nebula::cpp2::ErrorCode::E_TOTAL_CPU_CORE_EXCEED_LIMIT: {
LOG(ERROR) << "[License Manager] The number of CPU cores exceeds the limit, shutting down "
"the current node!";
std::raise(SIGTERM);
return Status::Error(" Cpu cores exceeds the limit!");
return Status::Error("The number of CPU cores exceeds the limit!");
}
case nebula::cpp2::ErrorCode::E_INVALID_LICENSE_MANAGER_STATUS: {
LOG(ERROR)
<< "[License Manager] Invalid license manager status, shutting down the current node!";
LOG(ERROR) << "[License Manager] Invalid license manager status, shutting down the current "
"node, please check the license manager status!";
std::raise(SIGTERM);
return Status::Error(" Invalid license manager status!");
}
Expand Down
2 changes: 0 additions & 2 deletions src/codec/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ set(expression_dep_libs
$<TARGET_OBJECTS:thread_obj>
$<TARGET_OBJECTS:file_based_cluster_id_man_obj>
$<TARGET_OBJECTS:version_obj>
$<TARGET_OBJECTS:encryption_obj>
$<TARGET_OBJECTS:network_obj>
$<TARGET_OBJECTS:conf_obj>
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:time_utils_obj>
Expand Down
2 changes: 0 additions & 2 deletions src/common/base/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ set(expression_dep_libs
$<TARGET_OBJECTS:thread_obj>
$<TARGET_OBJECTS:file_based_cluster_id_man_obj>
$<TARGET_OBJECTS:version_obj>
$<TARGET_OBJECTS:encryption_obj>
$<TARGET_OBJECTS:network_obj>
$<TARGET_OBJECTS:conf_obj>
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:time_utils_obj>
Expand Down
2 changes: 0 additions & 2 deletions src/common/datatypes/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ set(expression_dep_libs
$<TARGET_OBJECTS:thread_obj>
$<TARGET_OBJECTS:file_based_cluster_id_man_obj>
$<TARGET_OBJECTS:version_obj>
$<TARGET_OBJECTS:encryption_obj>
$<TARGET_OBJECTS:network_obj>
$<TARGET_OBJECTS:conf_obj>
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:time_utils_obj>
Expand Down
5 changes: 0 additions & 5 deletions src/common/encryption/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
#
# This source code is licensed under Apache 2.0 License.

nebula_add_library(
encryption_obj OBJECT
License.cpp
)

nebula_add_library(
encryption_utils_obj OBJECT
EncryptionUtils.cpp
Expand Down
6 changes: 6 additions & 0 deletions src/common/encryption/LMConnectorStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ struct LMStatusHelper {
return "Unknown";
}
}

// Overflow is considered normal, because it returns the maximum possible usage
static bool isStatusNormal(LMStatus status) {
return status == LMStatus::Ready || status == LMStatus::Expiring ||
status == LMStatus::Expired || status == LMStatus::Overflow;
}
};

} // namespace nebula
Loading

0 comments on commit de4fb65

Please sign in to comment.