Skip to content

Commit

Permalink
Merge branch 'master' into fix-drop-host
Browse files Browse the repository at this point in the history
  • Loading branch information
CPWstatic authored Sep 16, 2021
2 parents 0064080 + 6fe6f25 commit 015bd85
Show file tree
Hide file tree
Showing 125 changed files with 3,458 additions and 785 deletions.
6 changes: 5 additions & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
---
name: Bug report
name: Bug report
about: Help us to improve this project
title: ''
labels: bug
assignees: ''

---

**Please check the FAQ documentation before raising an issue**

Please check the [FAQ](https://github.com/vesoft-inc/nebula/blob/master/docs/manual-EN/1.overview/2.quick-start/2.FAQ.md) documentation and old issues before raising an issue in case someone has asked the same question that you are asking.
Expand Down
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature req
assignees: ''

---

Expand Down
10 changes: 8 additions & 2 deletions .github/actions/tagname-action/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# Extract tag name

Extract tag name from release branch
Extract tag information from release branch

## Outputs

### `tag`

tag name

### `tagnum`

tag number

## Example usage

```yaml
- uses: ./.github/actions/tagname-action
id: tag

- name: Other step
run: echo ${{ steps.tag.outputs.tag }}
run: |
echo ${{ steps.tag.outputs.tag }}
echo ${{ steps.tag.outputs.tagnum }}
```
9 changes: 7 additions & 2 deletions .github/actions/tagname-action/action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
name: 'Extract tag name'
description: 'Extract tag name'
name: 'Extract tag information'
description: 'Extract tag information'
outputs:
tag:
description: 'tag name'
value: ${{ steps.tag.outputs.tag }}
tagnum:
description: 'tag number'
value: ${{ steps.tag.outputs.tagnum }}
runs:
using: "composite"
steps:
- id: tag
run: |
tag=$(echo ${{ github.ref }} | rev | cut -d/ -f1 | rev)
tagnum=$(echo $tag |sed 's/^v//')
echo "::set-output name=tag::$tag"
echo "::set-output name=tagnum::$tagnum"
shell: bash
5 changes: 3 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
container:
image: vesoft/nebula-dev:${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: package
run: ./package/package.sh
- name: output some vars
Expand Down Expand Up @@ -69,7 +69,8 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: vesoft/nebula-${{ matrix.service }}
path: .
dockerfile: docker/Dockerfile.${{ matrix.service }}
tags: v2-nightly
tags: nightly,v2-nightly
cache_froms: vesoft/nebula-dev:centos7
add_git_labels: true
23 changes: 9 additions & 14 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ on:
branches:
- master
- 'v[0-9]+.*'
paths-ignore:
- 'docs/**'
- 'LICENSES/**'
- 'LICENSE'
- '**.md'

defaults:
run:
Expand Down Expand Up @@ -53,10 +48,10 @@ jobs:
- ubuntu2004
compiler:
- gcc-9.2
- clang-9
- clang-10
exclude:
- os: centos7
compiler: clang-9
compiler: clang-10
container:
image: vesoft/nebula-dev:${{ matrix.os }}
env:
Expand All @@ -66,9 +61,9 @@ jobs:
- /tmp/ccache/nebula/${{ matrix.os }}-${{ matrix.compiler }}:/tmp/ccache/nebula/${{ matrix.os }}-${{ matrix.compiler }}
options: --cap-add=SYS_PTRACE
steps:
- name: Cleanup
if: ${{ always() }}
run: rm -rf *
- uses: webiny/action-post-run@2.0.1
with:
run: sh -c "find . -mindepth 1 -delete"
- uses: actions/checkout@v2
- name: Prepare environment
id: prepare
Expand Down Expand Up @@ -118,7 +113,7 @@ jobs:
- name: Make
run: |
ccache -z
cmake --build build/ -j $(nproc)
cmake --build build/ -j $(($(nproc)/2+1))
ccache -s
- name: CTest
env:
Expand All @@ -143,16 +138,16 @@ jobs:
timeout-minutes: 60
- name: Down cluster
run: |
make down
make RM_DIR=false down
working-directory: tests/
timeout-minutes: 2
- name: Sanitizer
if: ${{ always() }}
run: |
exit $(grep -P "SUMMARY: AddressSanitizer: \d+ byte\(s\) leaked in \d+ allocation\(s\)\." build/server_*/logs/*stderr.log | wc -l)
- name: Upload logs
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: ${{ matrix.os }}-${{ matrix.compiler }}-nebula-test-logs
path: build/server_*/logs/
path: ./build/server_*/logs/
26 changes: 10 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,27 @@ jobs:
- centos8
container:
image: vesoft/nebula-dev:${{ matrix.os }}
env:
BUILD_DIR: ./pkg-build
CPACK_DIR: ./pkg-build/cpack_output
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: ./.github/actions/tagname-action
id: tag
- name: package
run: ./package/package.sh -b ${{ steps.tag.outputs.tag }}
- name: output some vars
id: vars
env:
SHA_EXT: sha256sum.txt
run: |
tag=$(echo ${{ github.ref }} | rev | cut -d/ -f1 | rev)
filename=$(find pkg-build/cpack_output -type f \( -iname \*.deb -o -iname \*.rpm \))
sha256sum $filename > $filename.$SHA_EXT
subdir=$(echo $tag |sed 's/^v//')
echo "::set-output name=subdir::$subdir"
- uses: ./.github/actions/upload-assets-action
with:
asset-path: pkg-build/cpack_output
tag: ${{ steps.tag.outputs.tag }}
tar zcf ${{ env.CPACK_DIR }}/nebula-${{ steps.tag.outputs.tagnum }}.tar.gz --exclude=${{ env.BUILD_DIR }} ./*
find ${{ env.CPACK_DIR }} -type f \( -iname \*.deb -o -iname \*.rpm \) -exec bash -c "sha256sum {} > {}.sha256sum.txt" \;
- uses: ./.github/actions/upload-to-oss-action
with:
key-id: ${{ secrets.OSS_ID }}
key-secret: ${{ secrets.OSS_SECRET }}
endpoint: ${{ secrets.OSS_ENDPOINT }}
bucket: nebula-graph
asset-path: pkg-build/cpack_output
target-path: package/${{ steps.vars.outputs.subdir }}
asset-path: ${{ env.CPACK_DIR }}
target-path: package/${{ steps.tag.outputs.tagnum }}

docker_build:
name: docker-build
Expand All @@ -76,8 +69,9 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile.${{ matrix.service }}
tags: vesoft/nebula-${{ matrix.service }}:${{ steps.tagname.outputs.tag }}
tags: vesoft/nebula-${{ matrix.service }}:${{ steps.tagname.outputs.tag }},vesoft/nebula-${{ matrix.service }}:latest
push: true
build-args: |
BRANCH=${{ steps.tagname.outputs.tag }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ venv/

#lock
*.lock

#ctags
.tags
1 change: 1 addition & 0 deletions .linters/cpp/checkKeyword.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
'KW_DESCRIBE',
'KW_DESC',
'KW_VERTEX',
'KW_VERTICES',
'KW_EDGE',
'KW_EDGES',
'KW_UPDATE',
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ nebula_add_subdirectory(scripts)
include(CPackage)
package(
${ENABLE_PACK_ONE}
"nebula"
"nebula-graph"
"https://github.com/vesoft-inc/nebula/releases"
${CMAKE_SOURCE_DIR}/package
)
2 changes: 1 addition & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Nebula Graph 1.x 后续不再进行功能的更新,请升级到2.0版本中。

## 联系方式

* 访问[官网](http://nebula-graph.com/)
* 访问[官网](http://nebula-graph.com.cn/)
* [![WeiXin](https://img.shields.io/badge/WeChat-%E5%BE%AE%E4%BF%A1-brightgreen)](https://user-images.githubusercontent.com/38887077/67449282-4362b300-f64c-11e9-878f-7efc373e5e55.jpg)
* [![Sina Weibo](https://img.shields.io/badge/Weibo-%E5%BE%AE%E5%8D%9A-red)](https://weibo.com/p/1006067122684542/home?from=page_100606&mod=TAB#place)
* [知乎](https://www.zhihu.com/org/nebulagraph/activities)
Expand Down
2 changes: 2 additions & 0 deletions conf/nebula-graphd.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
# Whether to treat partial success as an error.
# This flag is only used for Read-only access, and Modify access always treats partial success as an error.
--accept_partial_success=false
# Maximum sentence length, unit byte
--max_allowed_query_size=4194304

########## networking ##########
# Comma separated Meta Server Addresses
Expand Down
2 changes: 2 additions & 0 deletions conf/nebula-graphd.conf.production
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
# Whether to treat partial success as an error.
# This flag is only used for Read-only access, and Modify access always treats partial success as an error.
--accept_partial_success=false
# Maximum sentence length, unit byte
--max_allowed_query_size=4194304

########## networking ##########
# Comma separated Meta Server Addresses
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG BRANCH=master
COPY . /home/nebula/BUILD

RUN cd /home/nebula/BUILD/package \
&& ./package.sh -v $(git rev-parse --short HEAD) -n OFF -b ${BRANCH}
&& ./package.sh -n OFF -b ${BRANCH}

FROM centos:7 as graphd

Expand All @@ -15,8 +15,8 @@ COPY --from=builder /home/nebula/BUILD/pkg-build/cpack_output/nebula-*-graph.rpm
WORKDIR /usr/local/nebula

RUN rpm -ivh *.rpm \
&& mkdir -p ./{logs,data,pids} \
&& rm -rf *.rpm
&& mkdir -p ./{logs,data,pids} \
&& rm -rf *.rpm

EXPOSE 9669 19669 19670

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.graphd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY . /home/nebula/BUILD
ARG BRANCH=master

RUN cd /home/nebula/BUILD/package \
&& ./package.sh -v $(git rev-parse --short HEAD) -n OFF -b ${BRANCH} -g OFF
&& ./package.sh -n OFF -b ${BRANCH} -g OFF

FROM centos:7

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.metad
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG BRANCH=master
COPY . /home/nebula/BUILD

RUN cd /home/nebula/BUILD/package \
&& ./package.sh -v $(git rev-parse --short HEAD) -n OFF -b ${BRANCH}
&& ./package.sh -n OFF -b ${BRANCH}

FROM centos:7

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.storaged
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG BRANCH=master
COPY . /home/nebula/BUILD

RUN cd /home/nebula/BUILD/package \
&& ./package.sh -v $(git rev-parse --short HEAD) -n OFF -b ${BRANCH}
&& ./package.sh -n OFF -b ${BRANCH}

FROM centos:7

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.tools
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG BRANCH=master
COPY . /home/nebula/BUILD

RUN cd /home/nebula/BUILD/package \
&& ./package.sh -v $(git rev-parse --short HEAD) -n OFF -b ${BRANCH}
&& ./package.sh -n OFF -b ${BRANCH}

FROM centos:7

Expand Down
2 changes: 1 addition & 1 deletion package/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Package nebula as deb/rpm package
#
# introduce the args
# -v: The version of package, the version should be match tag name, default value is the `commitId`
# -v: The version of package, the version should be match tag name, default value is null
# -n: Package to one or multi-packages, `ON` means one package, `OFF` means multi packages, default value is `ON`
# -s: Whether to strip the package, default value is `FALSE`
# -b: Branch, default master
Expand Down
2 changes: 1 addition & 1 deletion src/clients/meta/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "webservice/Common.h"

DEFINE_uint32(expired_time_factor, 5, "The factor of expired time based on heart beat interval");
DEFINE_int32(heartbeat_interval_secs, 10, "Heartbeat interval");
DEFINE_int32(heartbeat_interval_secs, 10, "Heartbeat interval in seconds");
DEFINE_int32(meta_client_retry_times, 3, "meta client retry times, 0 means no retry");
DEFINE_int32(meta_client_retry_interval_secs, 1, "meta client sleep interval between retry");
DEFINE_int32(meta_client_timeout_ms, 60 * 1000, "meta client timeout");
Expand Down
10 changes: 8 additions & 2 deletions src/clients/storage/GraphStorageClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,18 @@ folly::SemiFuture<StorageRpcResponse<cpp2::LookupIndexResp>> GraphStorageClient:
int32_t tagOrEdge,
const std::vector<std::string>& returnCols,
folly::EventBase* evb) {
// TODO(sky) : instead of isEdge and tagOrEdge to nebula::cpp2::SchemaID for graph layer.
auto status = getHostParts(space);
if (!status.ok()) {
return folly::makeFuture<StorageRpcResponse<cpp2::LookupIndexResp>>(
std::runtime_error(status.status().toString()));
}
nebula::cpp2::SchemaID schemaId;
if (isEdge) {
schemaId.set_edge_type(tagOrEdge);
} else {
schemaId.set_tag_id(tagOrEdge);
}

auto& clusters = status.value();
std::unordered_map<HostAddr, cpp2::LookupIndexRequest> requests;
Expand All @@ -510,8 +517,7 @@ folly::SemiFuture<StorageRpcResponse<cpp2::LookupIndexResp>> GraphStorageClient:

cpp2::IndexSpec spec;
spec.set_contexts(contexts);
spec.set_is_edge(isEdge);
spec.set_tag_or_edge_id(tagOrEdge);
spec.set_schema_id(schemaId);
req.set_indices(spec);
req.set_common(common);
}
Expand Down
4 changes: 2 additions & 2 deletions src/common/expression/CaseExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ const Value& CaseExpression::eval(ExpressionContext& ctx) {
return result_;
}
} else {
if (!when.isBool()) {
if (!when.isBool() && !when.isNull()) {
return Value::kNullBadType;
}
if (when.getBool()) {
if (when.isBool() && when.getBool()) {
result_ = whenThen.then->eval(ctx);
return result_;
}
Expand Down
1 change: 0 additions & 1 deletion src/daemons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ nebula_add_executable(
$<TARGET_OBJECTS:graph_thrift_obj>
$<TARGET_OBJECTS:storage_client_base_obj>
$<TARGET_OBJECTS:graph_storage_client_obj>
$<TARGET_OBJECTS:storage_client_base_obj>
$<TARGET_OBJECTS:concurrent_obj>
$<TARGET_OBJECTS:charset_obj>
$<TARGET_OBJECTS:graph_obj>
Expand Down
Loading

0 comments on commit 015bd85

Please sign in to comment.