Merge branch '3.0' into refactor/TD-33926
This commit is contained in:
commit
6ac5c64733
|
@ -0,0 +1,315 @@
|
|||
name: TDengine CI Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- 'main'
|
||||
- '3.0'
|
||||
- '3.1'
|
||||
paths-ignore:
|
||||
- 'packaging/**'
|
||||
- 'docs/**'
|
||||
repository_dispatch:
|
||||
types: [run-tests]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CONTAINER_NAME: 'taosd-test'
|
||||
WKDIR: '/var/lib/jenkins/workspace'
|
||||
WK: '/var/lib/jenkins/workspace/TDinternal'
|
||||
WKC: '/var/lib/jenkins/workspace/TDinternal/community'
|
||||
|
||||
jobs:
|
||||
fetch-parameters:
|
||||
runs-on:
|
||||
group: CI
|
||||
labels: [self-hosted, Linux, X64, testing]
|
||||
outputs:
|
||||
tdinternal: ${{ steps.parameters.outputs.tdinternal }}
|
||||
run_function_test: ${{ steps.parameters.outputs.run_function_test }}
|
||||
run_tdgpt_test: ${{ steps.parameters.outputs.run_tdgpt_test }}
|
||||
source_branch: ${{ steps.parameters.outputs.source_branch }}
|
||||
target_branch: ${{ steps.parameters.outputs.target_branch }}
|
||||
pr_number: ${{ steps.parameters.outputs.pr_number }}
|
||||
steps:
|
||||
- name: Determine trigger source and fetch parameters
|
||||
id: parameters
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# check the trigger source and get branch information
|
||||
if [ "${{ github.event_name }}" == "repository_dispatch" ]; then
|
||||
tdinternal="true"
|
||||
source_branch=${{ github.event.client_payload.tdinternal_source_branch }}
|
||||
target_branch=${{ github.event.client_payload.tdinternal_target_branch }}
|
||||
pr_number=${{ github.event.client_payload.tdinternal_pr_number }}
|
||||
run_tdgpt_test="true"
|
||||
run_function_test="true"
|
||||
else
|
||||
tdinternal="false"
|
||||
source_branch=${{ github.event.pull_request.head.ref }}
|
||||
target_branch=${{ github.event.pull_request.base.ref }}
|
||||
pr_number=${{ github.event.pull_request.number }}
|
||||
|
||||
# check whether to run tdgpt test cases
|
||||
cd ${{ env.WKC }}
|
||||
changed_files_non_doc=$(git --no-pager diff --name-only FETCH_HEAD `git merge-base FETCH_HEAD $target_branch`|grep -v "^docs/en/"|grep -v "^docs/zh/"|grep -v ".md$" | tr '\n' ' ' || :)
|
||||
|
||||
if [[ "$changed_files_non_doc" != '' && "$changed_files_non_doc" =~ /forecastoperator.c|anomalywindowoperator.c|tanalytics.h|tanalytics.c|tdgpt_cases.task|analytics/ ]]; then
|
||||
run_tdgpt_test="true"
|
||||
else
|
||||
run_tdgpt_test="false"
|
||||
fi
|
||||
|
||||
# check whether to run function test cases
|
||||
changed_files_non_tdgpt=$(git --no-pager diff --name-only FETCH_HEAD `git merge-base FETCH_HEAD $target_branch`|grep -v "^docs/en/"|grep -v "^docs/zh/"|grep -v ".md$" | grep -Ev "forecastoperator.c|anomalywindowoperator.c|tanalytics.h|tanalytics.c|tdgpt_cases.task|analytics" | tr '\n' ' ' ||:)
|
||||
if [ $changed_files_non_tdgpt != '' ]; then
|
||||
run_function_test="true"
|
||||
else
|
||||
run_function_test="false"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "tdinternal=$tdinternal" >> $GITHUB_OUTPUT
|
||||
echo "run_function_test=$run_function_test" >> $GITHUB_OUTPUT
|
||||
echo "run_tdgpt_test=$run_tdgpt_test" >> $GITHUB_OUTPUT
|
||||
echo "source_branch=$source_branch" >> $GITHUB_OUTPUT
|
||||
echo "target_branch=$target_branch" >> $GITHUB_OUTPUT
|
||||
echo "pr_number=$pr_number" >> $GITHUB_OUTPUT
|
||||
|
||||
run-tests-on-linux:
|
||||
needs: fetch-parameters
|
||||
runs-on:
|
||||
group: CI
|
||||
labels: [self-hosted, Linux, X64, testing]
|
||||
timeout-minutes: 200
|
||||
env:
|
||||
IS_TDINTERNAL: ${{ needs.fetch-parameters.outputs.tdinternal }}
|
||||
RUN_RUNCTION_TEST: ${{ needs.fetch-parameters.outputs.run_function_test }}
|
||||
RUN_TDGPT_TEST: ${{ needs.fetch-parameters.outputs.run_tdgpt_tests }}
|
||||
SOURCE_BRANCH: ${{ needs.fetch-parameters.outputs.source_branch }}
|
||||
TARGET_BRANCH: ${{ needs.fetch-parameters.outputs.target_branch }}
|
||||
PR_NUMBER: ${{ needs.fetch-parameters.outputs.pr_number }}
|
||||
steps:
|
||||
- name: Output the environment information
|
||||
run: |
|
||||
echo "::group::Environment Info"
|
||||
date
|
||||
hostname
|
||||
env
|
||||
echo "Runner: ${{ runner.name }}"
|
||||
echo "Trigger Source from TDinternal: ${{ env.IS_TDINTERNAL }}"
|
||||
echo "Workspace: ${{ env.WKDIR }}"
|
||||
git --version
|
||||
echo "${{ env.WKDIR }}/restore.sh -p ${{ env.PR_NUMBER }} -n ${{ github.run_number }} -c ${{ env.CONTAINER_NAME }}"
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Prepare repositories
|
||||
run: |
|
||||
set -euo pipefail
|
||||
prepare_environment() {
|
||||
cd "$1"
|
||||
git reset --hard
|
||||
git clean -f
|
||||
git remote prune origin
|
||||
git fetch
|
||||
git checkout "$2"
|
||||
}
|
||||
prepare_environment "${{ env.WK }}" "${{ env.TARGET_BRANCH }}"
|
||||
prepare_environment "${{ env.WKC }}" "${{ env.TARGET_BRANCH }}"
|
||||
|
||||
- name: Get latest codes and logs for TDinternal PR
|
||||
if: ${{ env.IS_TDINTERNAL == 'true' }}
|
||||
run: |
|
||||
cd ${{ env.WK }}
|
||||
git pull >/dev/null
|
||||
git log -5
|
||||
echo "`date "+%Y%m%d-%H%M%S"` TDinternalTest/${{ env.PR_NUMBER }}:${{ github.run_number }}:${{ env.TARGET_BRANCH }}" >>${{ env.WKDIR }}/jenkins.log
|
||||
echo "CHANGE_BRANCH:${{ env.SOURCE_BRANCH }}" >>${{ env.WKDIR }}/jenkins.log
|
||||
echo "TDinternal log: `git log -5`" >>${{ env.WKDIR }}/jenkins.log
|
||||
git fetch origin +refs/pull/${{ env.PR_NUMBER }}/merge
|
||||
git checkout -qf FETCH_HEAD
|
||||
git log -5
|
||||
echo "TDinternal log merged: `git log -5`" >>${{ env.WKDIR }}/jenkins.log
|
||||
cd ${{ env.WKC }}
|
||||
git remote prune origin
|
||||
git pull >/dev/null
|
||||
git log -5
|
||||
echo "community log: `git log -5`" >>${{ env.WKDIR }}/jenkins.log
|
||||
- name: Get latest codes and logs for TDengine PR
|
||||
if: ${{ env.IS_TDINTERNAL == 'false' }}
|
||||
run: |
|
||||
cd ${{ env.WKC }}
|
||||
git remote prune origin
|
||||
git pull >/dev/null
|
||||
git log -5
|
||||
echo "`date "+%Y%m%d-%H%M%S"` TDengineTest/${{ env.PR_NUMBER }}:${{ github.run_number }}:${{ env.TARGET_BRANCH }}" >>${{ env.WKDIR }}/jenkins.log
|
||||
echo "CHANGE_BRANCH:${{ env.SOURCE_BRANCH }}" >>${{ env.WKDIR }}/jenkins.log
|
||||
echo "community log: `git log -5`" >>${{ env.WKDIR }}/jenkins.log
|
||||
git fetch origin +refs/pull/${{ env.PR_NUMBER }}/merge
|
||||
git checkout -qf FETCH_HEAD
|
||||
git log -5
|
||||
echo "community log merged: `git log -5`" >>${{ env.WKDIR }}/jenkins.log
|
||||
cd ${{ env.WK }}
|
||||
git pull >/dev/null
|
||||
git log -5
|
||||
echo "TDinternal log: `git log -5`" >>${{ env.WKDIR }}/jenkins.log
|
||||
- name: Update submodule
|
||||
run: |
|
||||
cd ${{ env.WKC }}
|
||||
git submodule update --init --recursive
|
||||
- name: Output the 'file_no_doc_changed' information to the file
|
||||
if: ${{ env.IS_TDINTERNAL == 'false' }}
|
||||
run: |
|
||||
mkdir -p ${{ env.WKDIR }}/tmp/${{ env.PR_NUMBER }}_${{ github.run_number }}
|
||||
changed_files_non_doc=$(git --no-pager diff --name-only FETCH_HEAD `git merge-base FETCH_HEAD ${{ env.TARGET_BRANCH }}`|grep -v "^docs/en/"|grep -v "^docs/zh/"|grep -v ".md$" | tr '\n' ' ' || :)
|
||||
echo $changed_files_non_doc > ${{ env.WKDIR }}/tmp/${{ env.PR_NUMBER }}_${{ github.run_number }}/docs_changed.txt
|
||||
- name: Check assert testing
|
||||
run: |
|
||||
cd ${{ env.WKC }}/tests/parallel_test
|
||||
./run_check_assert_container.sh -d ${{ env.WKDIR }}
|
||||
- name: Check void function testing
|
||||
run: |
|
||||
cd ${{ env.WKC }}/tests/parallel_test
|
||||
./run_check_void_container.sh -d ${{ env.WKDIR }}
|
||||
- name: Build docker container
|
||||
run: |
|
||||
date
|
||||
rm -rf ${{ env.WKC }}/debug
|
||||
cd ${{ env.WKC }}/tests/parallel_test
|
||||
time ./container_build.sh -w ${{ env.WKDIR }} -e
|
||||
- name: Get parameters for testing
|
||||
id: get_param
|
||||
run: |
|
||||
log_server_file="/home/log_server.json"
|
||||
timeout_cmd=""
|
||||
extra_param=""
|
||||
|
||||
if [ -f "$log_server_file" ]; then
|
||||
log_server_enabled=$(jq '.enabled' "$log_server_file")
|
||||
timeout_param=$(jq '.timeout' "$log_server_file")
|
||||
if [ "$timeout_param" != "null" ] && [ "$timeout_param" != "0" ]; then
|
||||
timeout_cmd="timeout $timeout_param"
|
||||
fi
|
||||
|
||||
if [ "$log_server_enabled" == "1" ]; then
|
||||
log_server=$(jq '.server' "$log_server_file" | sed 's/\\\"//g')
|
||||
if [ "$log_server" != "null" ] && [ "$log_server" != "" ]; then
|
||||
extra_param="-w $log_server"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
echo "timeout_cmd=$timeout_cmd" >> $GITHUB_OUTPUT
|
||||
echo "extra_param=$extra_param" >> $GITHUB_OUTPUT
|
||||
- name: Run function returns with a null pointer scan testing
|
||||
run: |
|
||||
cd ${{ env.WKC }}/tests/parallel_test
|
||||
./run_scan_container.sh -d ${{ env.WKDIR }} -b ${{ env.PR_NUMBER }}_${{ github.run_number }} -f ${{ env.WKDIR }}/tmp/${{ env.PR_NUMBER }}_${{ github.run_number }}/docs_changed.txt ${{ steps.get_param.outputs.extra_param }}
|
||||
- name: Run tdgpt test cases
|
||||
if: ${{ env.IS_TDINTERNAL }} == 'false' && ${{ env.RUN_TDGPT_TEST }} == 'true'
|
||||
run: |
|
||||
cd ${{ env.WKC }}/tests/parallel_test
|
||||
export DEFAULT_RETRY_TIME=2
|
||||
date
|
||||
timeout 600 time ./run.sh -e -m /home/m.json -t tdgpt_cases.task -b ${{ env.PR_NUMBER }}_${{ github.run_number }} -l ${{ env.WKDIR }}/log -o 300 ${{ steps.get_param.outputs.extra_param }}
|
||||
- name: Run function test cases
|
||||
if: ${{ env.RUN_RUNCTION_TEST }} == 'true'
|
||||
run: |
|
||||
cd ${{ env.WKC }}/tests/parallel_test
|
||||
export DEFAULT_RETRY_TIME=2
|
||||
date
|
||||
${{ steps.get_param.outputs.timeout_cmd }} time ./run.sh -e -m /home/m.json -t cases.task -b ${{ env.PR_NUMBER }}_${{ github.run_number }} -l ${{ env.WKDIR }}/log -o 1200 ${{ steps.get_param.outputs.extra_param }}
|
||||
|
||||
run-tests-on-mac:
|
||||
needs: fetch-parameters
|
||||
if: ${{ needs.fetch-parameters.outputs.run_function_test == 'false' }}
|
||||
runs-on:
|
||||
group: CI
|
||||
labels: [self-hosted, macOS, ARM64, testing]
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
IS_TDINTERNAL: ${{ needs.fetch-parameters.outputs.tdinternal }}
|
||||
SOURCE_BRANCH: ${{ needs.fetch-parameters.outputs.source_branch }}
|
||||
TARGET_BRANCH: ${{ needs.fetch-parameters.outputs.target_branch }}
|
||||
PR_NUMBER: ${{ needs.fetch-parameters.outputs.pr_number }}
|
||||
steps:
|
||||
- name: Output the environment information
|
||||
run: |
|
||||
echo "::group::Environment Info"
|
||||
date
|
||||
hostname
|
||||
env
|
||||
echo "Runner: ${{ runner.name }}"
|
||||
echo "Trigger Source from TDinternal: ${{ env.IS_TDINTERNAL }}"
|
||||
echo "Workspace: ${{ env.WKDIR }}"
|
||||
git --version
|
||||
echo "${{ env.WKDIR }}/restore.sh -p ${{ env.PR_NUMBER }} -n ${{ github.run_number }} -c ${{ env.CONTAINER_NAME }}"
|
||||
echo "::endgroup::"
|
||||
- name: Prepare repositories
|
||||
run: |
|
||||
set -euo pipefail
|
||||
prepare_environment() {
|
||||
cd "$1"
|
||||
git reset --hard
|
||||
git clean -f
|
||||
git remote prune origin
|
||||
git fetch
|
||||
git checkout "$2"
|
||||
}
|
||||
prepare_environment "${{ env.WK }}" "${{ env.TARGET_BRANCH }}"
|
||||
prepare_environment "${{ env.WKC }}" "${{ env.TARGET_BRANCH }}"
|
||||
- name: Get latest codes and logs for TDinternal PR
|
||||
if: ${{ env.IS_TDINTERNAL == 'true' }}
|
||||
run: |
|
||||
cd ${{ env.WK }}
|
||||
git pull >/dev/null
|
||||
git log -5
|
||||
echo "`date "+%Y%m%d-%H%M%S"` TDinternalTest/${{ env.PR_NUMBER }}:${{ github.run_number }}:${{ env.TARGET_BRANCH }}" >>${{ env.WKDIR }}/jenkins.log
|
||||
echo "CHANGE_BRANCH:${{ env.SOURCE_BRANCH }}" >>${{ env.WKDIR }}/jenkins.log
|
||||
echo "TDinternal log: `git log -5`" >>${{ env.WKDIR }}/jenkins.log
|
||||
git fetch origin +refs/pull/${{ env.PR_NUMBER }}/merge
|
||||
git checkout -qf FETCH_HEAD
|
||||
git log -5
|
||||
echo "TDinternal log merged: `git log -5`" >>${{ env.WKDIR }}/jenkins.log
|
||||
cd ${{ env.WKC }}
|
||||
git remote prune origin
|
||||
git pull >/dev/null
|
||||
git log -5
|
||||
echo "community log: `git log -5`" >>${{ env.WKDIR }}/jenkins.log
|
||||
- name: Get latest codes and logs for TDengine PR
|
||||
if: ${{ env.IS_TDINTERNAL == 'false' }}
|
||||
run: |
|
||||
cd ${{ env.WKC }}
|
||||
git remote prune origin
|
||||
git pull >/dev/null
|
||||
git log -5
|
||||
echo "`date "+%Y%m%d-%H%M%S"` TDengineTest/${{ env.PR_NUMBER }}:${{ github.run_number }}:${{ env.TARGET_BRANCH }}" >>${{ env.WKDIR }}/jenkins.log
|
||||
echo "CHANGE_BRANCH:${{ env.SOURCE_BRANCH }}" >>${{ env.WKDIR }}/jenkins.log
|
||||
echo "community log: `git log -5`" >>${{ env.WKDIR }}/jenkins.log
|
||||
git fetch origin +refs/pull/${{ env.PR_NUMBER }}/merge
|
||||
git checkout -qf FETCH_HEAD
|
||||
git log -5
|
||||
echo "community log merged: `git log -5`" >>${{ env.WKDIR }}/jenkins.log
|
||||
cd ${{ env.WK }}
|
||||
git pull >/dev/null
|
||||
git log -5
|
||||
echo "TDinternal log: `git log -5`" >>${{ env.WKDIR }}/jenkins.log
|
||||
- name: Update submodule
|
||||
run: |
|
||||
cd ${{ env.WKC }}
|
||||
git submodule update --init --recursive
|
||||
- name: Run tests
|
||||
run: |
|
||||
date
|
||||
cd ${{ env.WK }}
|
||||
rm -rf debug
|
||||
mkdir debug
|
||||
cd ${{ env.WK }}/debug
|
||||
echo $PATH
|
||||
echo "PATH=/opt/homebrew/bin:$PATH" >> $GITHUB_ENV
|
||||
cmake .. -DBUILD_TEST=true -DBUILD_HTTPS=false -DCMAKE_BUILD_TYPE=Release
|
||||
make -j10
|
||||
ctest -j10 || exit 7
|
||||
date
|
|
@ -1,17 +1,14 @@
|
|||
name: TDengine Doc Build
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
target_branch:
|
||||
description: "Target branch name of for building the document"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
target_pr_number:
|
||||
description: "PR number of target branch to merge for building the document"
|
||||
required: true
|
||||
type: string
|
||||
pull_request:
|
||||
branches:
|
||||
- 'main'
|
||||
- '3.0'
|
||||
- '3.1'
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
|
||||
env:
|
||||
DOC_WKC: "/root/doc_ci_work"
|
||||
|
@ -21,81 +18,32 @@ env:
|
|||
TOOLS_REPO: "taos-tools"
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on:
|
||||
group: CI
|
||||
labels: [self-hosted, doc-build]
|
||||
outputs:
|
||||
changed_files_zh: ${{ steps.set_output.outputs.changed_files_zh }}
|
||||
changed_files_en: ${{ steps.set_output.outputs.changed_files_en }}
|
||||
changed_files_non_doc: ${{ steps.set_output.outputs.changed_files_non_doc }}
|
||||
changed_files_non_tdgpt: ${{ steps.set_output.outputs.changed_files_non_tdgpt }}
|
||||
steps:
|
||||
- name: Get the latest document contents from the repository
|
||||
run: |
|
||||
set -e
|
||||
# ./.github/scripts/update_repo.sh ${{ env.DOC_WKC }}/${{ env.TD_REPO }} ${{ inputs.target_branch }} ${{ inputs.target_pr_number }}
|
||||
cd ${{ env.DOC_WKC }}/${{ env.TD_REPO }}
|
||||
git reset --hard
|
||||
git clean -f
|
||||
git remote prune origin
|
||||
git fetch
|
||||
git checkout ${{ inputs.target_branch }}
|
||||
git pull >/dev/null
|
||||
git fetch origin +refs/pull/${{ inputs.target_pr_number }}/merge
|
||||
git checkout -qf FETCH_HEAD
|
||||
- name: Check whether the document is changed and set output variables
|
||||
id: set_output
|
||||
run: |
|
||||
set -e
|
||||
cd ${{ env.DOC_WKC }}/${{ env.TD_REPO }}
|
||||
changed_files_zh=$(git --no-pager diff --name-only FETCH_HEAD `git merge-base FETCH_HEAD ${{ inputs.tartget_branch }}`| grep "^docs/zh/" | tr '\n' ' ' || :)
|
||||
changed_files_en=$(git --no-pager diff --name-only FETCH_HEAD `git merge-base FETCH_HEAD ${{ inputs.tartget_branch }}`| grep "^docs/en/" | tr '\n' ' ' || :)
|
||||
changed_files_non_doc=$(git --no-pager diff --name-only FETCH_HEAD `git merge-base FETCH_HEAD ${{ inputs.tartget_branch }}`|grep -v "^docs/en/"|grep -v "^docs/zh/"|grep -v ".md$" | tr '\n' ' ' || :)
|
||||
changed_files_non_tdgpt=$(git --no-pager diff --name-only FETCH_HEAD `git merge-base FETCH_HEAD ${{ inputs.tartget_branch }}`|grep -v "^docs/en/"|grep -v "^docs/zh/"|grep -v ".md$" | grep -Ev "forecastoperator.c|anomalywindowoperator.c|tanalytics.h|tanalytics.c|tdgpt_cases.task|analytics" | tr '\n' ' ' ||:)
|
||||
echo "changed_files_zh=${changed_files_zh}" >> $GITHUB_OUTPUT
|
||||
echo "changed_files_en=${changed_files_en}" >> $GITHUB_OUTPUT
|
||||
echo "changed_files_non_doc=${changed_files_non_doc}" >> $GITHUB_OUTPUT
|
||||
echo "changed_files_non_tdgpt=${changed_files_non_tdgpt}" >> $GITHUB_OUTPUT
|
||||
|
||||
build:
|
||||
needs: check
|
||||
build-doc:
|
||||
runs-on:
|
||||
group: CI
|
||||
labels: [self-hosted, doc-build]
|
||||
if: ${{ needs.check.outputs.changed_files_zh != '' || needs.check.outputs.changed_files_en != '' }}
|
||||
|
||||
steps:
|
||||
- name: Get the latest document contents
|
||||
run: |
|
||||
set -e
|
||||
#./.github/scripts/update_repo.sh ${{ env.DOC_WKC }}/${{ env.TD_REPO }} ${{ inputs.target_branch }} ${{ inputs.target_pr_number }}
|
||||
cd ${{ env.DOC_WKC }}/${{ env.TD_REPO }}
|
||||
git reset --hard
|
||||
git clean -f
|
||||
git remote prune origin
|
||||
git fetch
|
||||
git checkout ${{ inputs.target_branch }}
|
||||
git checkout ${{ github.event.pull_request.base.ref }}
|
||||
git pull >/dev/null
|
||||
git fetch origin +refs/pull/${{ inputs.target_pr_number }}/merge
|
||||
git fetch origin +refs/pull/${{ github.event.pull_request.number }}/merge
|
||||
git checkout -qf FETCH_HEAD
|
||||
|
||||
- name: Build the chinese document
|
||||
if: ${{ needs.check.outputs.changed_files_zh != '' }}
|
||||
run: |
|
||||
cd ${{ env.DOC_WKC }}/${{ env.ZH_DOC_REPO }}
|
||||
yarn ass local
|
||||
yarn build
|
||||
|
||||
- name: Build the english document
|
||||
if: ${{ needs.check.outputs.changed_files_en != '' }}
|
||||
run: |
|
||||
cd ${{ env.DOC_WKC }}/${{ env.EN_DOC_REPO }}
|
||||
yarn ass local
|
||||
yarn build
|
||||
|
||||
outputs:
|
||||
changed_files_zh: ${{ needs.check.outputs.changed_files_zh }}
|
||||
changed_files_en: ${{ needs.check.outputs.changed_files_en }}
|
||||
changed_files_non_doc: ${{ needs.check.outputs.changed_files_non_doc }}
|
||||
changed_files_non_tdgpt: ${{ needs.check.outputs.changed_files_non_tdgpt }}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
IF (DEFINED VERNUMBER)
|
||||
SET(TD_VER_NUMBER ${VERNUMBER})
|
||||
ELSE ()
|
||||
SET(TD_VER_NUMBER "3.3.5.2.alpha")
|
||||
SET(TD_VER_NUMBER "3.3.5.8.alpha")
|
||||
ENDIF ()
|
||||
|
||||
IF (DEFINED VERCOMPATIBLE)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# taosws-rs
|
||||
ExternalProject_Add(taosws-rs
|
||||
GIT_REPOSITORY https://github.com/taosdata/taos-connector-rust.git
|
||||
GIT_TAG 3.0
|
||||
GIT_TAG main
|
||||
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosws-rs"
|
||||
BINARY_DIR ""
|
||||
#BUILD_IN_SOURCE TRUE
|
||||
|
|
|
@ -7,7 +7,7 @@ Apache Superset is a modern enterprise level business intelligence (BI) web appl
|
|||
It is supported by the Apache Software Foundation and is an open source project with an active community and rich ecosystem.
|
||||
Apache Superset provides an intuitive user interface that makes creating, sharing, and visualizing data simple, while supporting multiple data sources and rich visualization options.
|
||||
|
||||
Through the Python connector of TDengine, Superset can support TDengine data sources and provide functions such as data presentation and analysis
|
||||
Through the Python connector of TDengine, Superset can support TDengine data sources and provide functions such as data presentation and analysis.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ Tableau is a well-known business intelligence tool that supports multiple data s
|
|||
|
||||
Prepare the following environment:
|
||||
|
||||
- TDengine 3.3.5.4 and above version is installed and running normally (both Enterprise and Community versions are available)
|
||||
- taosAdapter is running normally, refer to [taosAdapter Reference](../../../tdengine-reference/components/taosadapter/)
|
||||
- TDengine 3.3.5.8 and above version is installed and running normally (both Enterprise and Community versions are available).
|
||||
- taosAdapter is running normally, refer to [taosAdapter Reference](../../../tdengine-reference/components/taosadapter/).
|
||||
- Install and run Tableau Desktop (if not installed, please download and install Windows operating system 64-bit [Download Tableau Desktop](https://www.tableau.com/products/desktop/download)). Install Tableau please refer to [Tableau Desktop](https://www.tableau.com).
|
||||
- Download the latest Windows operating system X64 client driver from the TDengine official website and install it, refer to [Install ODBC Driver](../../../tdengine-reference/client-libraries/odbc/#Installation).
|
||||
|
||||
|
@ -19,6 +19,10 @@ Prepare the following environment:
|
|||
|
||||
**Step 1**, Search and open the "ODBC Data Source (64 bit)" management tool in the Start menu of the Windows operating system and configure it, refer to [Install ODBC Driver](../../../tdengine-reference/client-libraries/odbc/#Installation).
|
||||
|
||||
:::tip
|
||||
It should be noted that when configuring the ODBC data source for Tableau, the [Database] configuration item on the TDengine ODBC data source configuration page is required. You need to select a database that can be successfully connected.
|
||||
:::
|
||||
|
||||
**Step 2**, Start Tableau in the Windows system environment, then search for "ODBC" on its connection page and select "Other Databases (ODBC)".
|
||||
|
||||
**Step 3**, Click the `DSN` radio button, then select the configured data source (MyTDengine), and click the `Connect` button. After the connection is successful, delete the content of the string attachment, and finally click the `Sign In` button.
|
||||
|
|
|
@ -10,7 +10,7 @@ toc_max_heading_level: 4
|
|||
|
||||
Prepare the following environment:
|
||||
|
||||
- TDengine 3.3.5.7 and above version is installed and running normally (both Enterprise and Community versions are available).
|
||||
- TDengine 3.3.5.8 and above version is installed and running normally (both Enterprise and Community versions are available).
|
||||
- taosAdapter is running normally, refer to [taosAdapter Reference](../../../tdengine-reference/components/taosadapter/).
|
||||
- Install and run Excel. If not installed, please download and install it. For specific instructions, please refer to Microsoft's official documentation.
|
||||
- Download the latest Windows operating system X64 client driver from the TDengine official website and install it, refer to [Install ODBC Driver](../../../tdengine-reference/client-libraries/odbc/#Installation).
|
||||
|
|
|
@ -25,6 +25,10 @@ Download links for TDengine 3.x version installation packages are as follows:
|
|||
|
||||
import Release from "/components/ReleaseV3";
|
||||
|
||||
## 3.3.5.8
|
||||
|
||||
<Release type="tdengine" version="3.3.5.8" />
|
||||
|
||||
## 3.3.5.2
|
||||
|
||||
<Release type="tdengine" version="3.3.5.2" />
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
---
|
||||
title: TDengine 3.3.5.8 Release Notes
|
||||
sidebar_label: 3.3.5.8
|
||||
description: Version 3.3.5.8 Notes
|
||||
slug: /release-history/release-notes/3.3.5.8
|
||||
---
|
||||
|
||||
## Features
|
||||
1. feat: suppport tmq subscription with ONLY META in JDBC
|
||||
2. feat: support multiple-line SQL editor in Grafana
|
||||
3. feat: add support for VARBINARY/GEOMETRY in ODBC
|
||||
4. feat: support TDengine with ODBC dirver in Excel
|
||||
5. feat: taosX agent use specific port range in local connection
|
||||
|
||||
## Enhancements
|
||||
1. enh: websocket handle consumer error when tmq polled nothing
|
||||
2. enh: JDBC add support for unsigned integers
|
||||
3. enh: expose global.written_concurrent configuration for kafka/mqtt/csv in Explorer
|
||||
4. enh: support integration with TDgpt in community version
|
||||
5. enh: support BinaryRowData type in flink
|
||||
6. enh: in stmt2 SQL statements, the LIMIT clause supports the use of ? as a parameter placeholder
|
||||
7. enh: enable compression via websocket in taosX backup
|
||||
8. enh: ODBC support SQL_ROWSET_SIZE in SQLSetStmtAttr
|
||||
9. enh: expose num.of.consumers/writters configurations in Explorer
|
||||
10. enh: Add connector files to the macOS installation package.
|
||||
11. enh: handle errors when poll result is null in rust connector
|
||||
12. enh: tsbs support csv output format
|
||||
13. enh: add Classified Connections Counts table in TDinsight
|
||||
14. enh: use consist float precision in explorer and tao shell
|
||||
15. enh: flink table support update/delete
|
||||
16. enh: taosX agent will resume connection when taosX server disconnected for long time
|
||||
|
||||
## Fixes
|
||||
1. fix: explorer support signup email with dot `.`
|
||||
2. fix: flock syscall error on aws cloud storage in taosAdapter
|
||||
3. fix: modify boolean tag values in sub-tables results in erroneous metadata from data subscriptions.
|
||||
4. fix: allow spaces in columns of csv in explorer datain
|
||||
5. fix: resolved the issue of high CPU usage by the stmtbind thread when the system is in an idle state
|
||||
6. fix: health state tick to idle when no data consumed
|
||||
7. fix: fix security issues in JDBC sample code
|
||||
8. fix: fix upgrade compaibility issue of taosX
|
||||
9. fix: ODBC core when set SQL_ATTR_TXN_ISOLATION with SQLSetConnectAttr
|
||||
10. fix: received/processed_messages should be reset when task rerun
|
||||
11. fix: when restoring data using taosX, it may crash if the database is not specified
|
||||
12. fix: when creating a database, the keep_time_offset options supports suffixes h (hours) and d (days) for time values
|
||||
13. fix: potential deadlocks while drop stream
|
||||
14. fix: failed to write data in a dual-replica database when a single dnode is disconnected from the network
|
||||
15. fix: when querying the information_schema.ins_tables table, a "Sync leader is unreachable" error may be triggered if the Leader of the mnode changes.
|
||||
16. fix: the time-filtering query results involving composite primary keys were incorrect after data compact
|
||||
17. fix: when the join condition of the primary key column is not a simple equality condition, it may lead to incorrect JOIN results
|
||||
18. fix: error caused by cursor.fetchmany with custom length in python taosws
|
||||
19. fix: the issue where the "show grants" command returned an incorrect number of columns
|
||||
20. fix: unexpected backup points before schedule executing
|
||||
21. fix: taosX task does not restart after interrupted
|
||||
22. fix: jdbc select server_version() caused mem high-usage
|
||||
23. fix: when using the WHERE tbname IN () statement, executing LAST query may cause taosd crash if the subtables filtered out do not belong to the same super table
|
||||
24. fix: after taosd exits abnormally and is restarted, if the WAL that has not been written to the data file is too large, it may cause an OOM error during startup
|
||||
25. fix: when using interp interpolation, if the select list contains string constants or string tags, the returned string content may be incomplete.[#29353](https://github.com/taosdata/TDengine/issues/29353)
|
||||
26. fix: when performing a JOIN query on a super table, using a subquery as the right table may lead to missing results
|
||||
27. fix: syntax error while use DISTINCT and ORDER BY together.[#29263](https://github.com/taosdata/TDengine/issues/29263)
|
||||
28. fix: when using the CAST function to convert a floating-point number to a binary and then performing a comparison, the result may be inaccurate due to loss of precision[#29382](https://github.com/taosdata/TDengine/issues/29382)
|
||||
29. fix: after upgrading from version 3.3.4 to 3.3.5, the taosd service fails to start properly if the configured charset does not exist in the system
|
||||
30. fix: websocket api timing field should not be negtive
|
||||
31. fix: duplicates backup points in taosX
|
||||
32. fix: configuration item s3BucketName was incorrectly set as a global variable, leading to failures while file uploads to S3.
|
||||
|
|
@ -76,6 +76,17 @@ taosExplorer 服务页面中,进入“系统管理 - 备份”页面,在“
|
|||
8. 备份文件大小:备份文件的大小限制。当备份文件大小达到此限制时,会自动创建新的备份文件。
|
||||
9. 文件压缩等级:备份文件的压缩等级。支持:最快速度、最佳压缩比、兼具速度和压缩比。
|
||||
|
||||
用户可以通过开启 S3 转储,将备份文件上传至 S3 存储服务上。开启 S3 转储,需要填写以下信息:
|
||||
|
||||
1. S3 节点:S3 节点的地址。
|
||||
2. 访问密钥 ID:访问密钥 ID。
|
||||
3. 访问密钥:访问密钥。
|
||||
4. 存储桶:存储桶名称。
|
||||
5. 区域:存储桶所在的区域。
|
||||
6. 对象前缀:备份文件的对象前缀,类似于 S3 上的目录。
|
||||
7. 本地备份文件的保留时长:本地备份的保留时间,所有早于`当前时间 - backup_retention_period`的文件都需要上传到 S3。
|
||||
8. 本地备份文件的保留个数:本地备份文件的保留个数,本地只保留最新的`backup_retention_size`个备份文件。
|
||||
|
||||
创建成功后,备份计划会开始按照配置的参数运行。在“备份计划”下的列表中,可以查看已创建的备份计划。
|
||||
|
||||
备份计划支持以下操作:
|
||||
|
|
|
@ -8,8 +8,8 @@ Tableau 是一款知名的商业智能工具,它支持多种数据源,可方
|
|||
## 前置条件
|
||||
|
||||
准备以下环境:
|
||||
- TDengine 3.3.5.4 以上版本集群已部署并正常运行(企业及社区版均可)
|
||||
- taosAdapter 能够正常运行。详细参考 [taosAdapter 参考手册](../../../reference/components/taosadapter)
|
||||
- TDengine 3.3.5.8 以上版本集群已部署并正常运行(企业及社区版均可)。
|
||||
- taosAdapter 能够正常运行。详细参考 [taosAdapter 参考手册](../../../reference/components/taosadapter)。
|
||||
- Tableau 桌面版安装并运行(如未安装,请下载并安装 Windows 操作系统 64 位 [Tableau 桌面版](https://www.tableau.com/products/desktop/download) )。安装 Tableau 桌面版请参考 [官方文档](https://www.tableau.com)。
|
||||
- 从 TDengine 官网下载最新的 Windows 操作系统 X64 客户端驱动程序,并进行安装。详细参考 [安装 ODBC 驱动](../../../reference/connector/odbc/#安装)。
|
||||
|
||||
|
@ -18,7 +18,11 @@ Tableau 是一款知名的商业智能工具,它支持多种数据源,可方
|
|||
|
||||
**第 1 步**,在Windows操作系统的开始菜单中搜索并打开“ODBC数据源(64位)”管理工具并进行配置。详细参考[配置ODBC数据源](../../../reference/connector/odbc/#配置数据源)。
|
||||
|
||||
**第 2 步**,在 Windows 系统环境下启动 Tableau,之后在其连接页面中搜索 “ODBC”,并选择 “其他数据库 (ODBC)”。
|
||||
:::tip
|
||||
需要注意的是,在为 Tableau 配置 ODBC 数据源时,TDengine ODBC 数据源配置页面中的【数据库】配置项为必填项,需选择一个可成功连接的数据库。
|
||||
:::
|
||||
|
||||
**第 2 步**,在 Windows 系统环境下启动 Tableau,之后在其连接页面中搜索 “ODBC”,并选择 “其他数据库 (ODBC)”。 对于 Tableau 的使用的ODBC数据源,在其 TDengine ODBC 数据源配置页面的【数据库】的配置项为必填,需要选择可以连接的数据库。
|
||||
|
||||
**第 3 步**,点击 `DSN` 单选框,接着选择已配置好的数据源(MyTDengine),然后点击`连接`按钮。待连接成功后,删除字符串附加部分的内容,最后点击`登录`按钮即可。
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ title: 与 Excel 集成
|
|||
## 前置条件
|
||||
|
||||
准备以下环境:
|
||||
- TDengine 3.3.5.7 以上版本集群已部署并正常运行(企业及社区版均可)。
|
||||
- TDengine 3.3.5.8 以上版本集群已部署并正常运行(企业及社区版均可)。
|
||||
- taosAdapter 能够正常运行,详细参考 [taosAdapter 参考手册](../../../reference/components/taosadapter)。
|
||||
- Excel 安装并运行, 如未安装,请下载并安装, 具体操作请参考 Microsoft 官方文档。
|
||||
- 从 TDengine 官网下载最新的 Windows 操作系统 X64 客户端驱动程序并进行安装,详细参考 [安装 ODBC 驱动](../../../reference/connector/odbc/#安装)。
|
||||
|
|
|
@ -67,7 +67,7 @@ database_option: {
|
|||
- DURATION:数据文件存储数据的时间跨度。可以使用加单位的表示形式,如 DURATION 100h、DURATION 10d 等,支持 m(分钟)、h(小时)和 d(天)三个单位。不加时间单位时默认单位为天,如 DURATION 50 表示 50 天。
|
||||
- MAXROWS:文件块中记录的最大条数,默认为 4096 条。
|
||||
- MINROWS:文件块中记录的最小条数,默认为 100 条。
|
||||
- KEEP:表示数据文件保存的天数,缺省值为 3650,取值范围 [1, 365000],且必须大于或等于 3 倍的 DURATION 参数值。数据库会自动删除保存时间超过 KEEP 值的数据从而释放存储空间。KEEP 可以使用加单位的表示形式,如 KEEP 100h、KEEP 10d 等,支持 m(分钟)、h(小时)和 d(天)三个单位。也可以不写单位,如 KEEP 50,此时默认单位为天。企业版支持[多级存储](../../operation/planning/#%E5%A4%9A%E7%BA%A7%E5%AD%98%E5%82%A8)功能, 因此, 可以设置多个保存时间(多个以英文逗号分隔,最多 3 个,满足 keep 0 \<= keep 1 \<= keep 2,如 KEEP 100h,100d,3650d); 社区版不支持多级存储功能(即使配置了多个保存时间, 也不会生效, KEEP 会取最大的保存时间)。了解更多,请点击 [关于主键时间戳](https://docs.taosdata.com/reference/taos-sql/insert/)
|
||||
- KEEP:表示数据文件保存的天数,缺省值为 3650,取值范围 [1, 365000],且必须大于或等于 3 倍的 DURATION 参数值。数据库会自动删除保存时间超过 KEEP 值的数据从而释放存储空间。KEEP 可以使用加单位的表示形式,如 KEEP 100h、KEEP 10d 等,支持 m(分钟)、h(小时)和 d(天)三个单位。也可以不写单位,如 KEEP 50,此时默认单位为天。企业版支持[多级存储](https://docs.taosdata.com/operation/planning/#%E5%A4%9A%E7%BA%A7%E5%AD%98%E5%82%A8)功能, 因此, 可以设置多个保存时间(多个以英文逗号分隔,最多 3 个,满足 keep 0 \<= keep 1 \<= keep 2,如 KEEP 100h,100d,3650d); 社区版不支持多级存储功能(即使配置了多个保存时间, 也不会生效, KEEP 会取最大的保存时间)。了解更多,请点击 [关于主键时间戳](https://docs.taosdata.com/reference/taos-sql/insert/)
|
||||
|
||||
- KEEP_TIME_OFFSET:自 3.2.0.0 版本生效。删除或迁移保存时间超过 KEEP 值的数据的延迟执行时间,默认值为 0 (小时)。在数据文件保存时间超过 KEEP 后,删除或迁移操作不会立即执行,而会额外等待本参数指定的时间间隔,以实现与业务高峰期错开的目的。
|
||||
- STT_TRIGGER:表示落盘文件触发文件合并的个数。对于少表高频写入场景,此参数建议使用默认配置;而对于多表低频写入场景,此参数建议配置较大的值。
|
||||
|
|
|
@ -24,6 +24,10 @@ TDengine 3.x 各版本安装包下载链接如下:
|
|||
|
||||
import Release from "/components/ReleaseV3";
|
||||
|
||||
## 3.3.5.8
|
||||
|
||||
<Release type="tdengine" version="3.3.5.8" />
|
||||
|
||||
## 3.3.5.2
|
||||
|
||||
<Release type="tdengine" version="3.3.5.2" />
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
title: 3.3.5.8 版本说明
|
||||
sidebar_label: 3.3.5.8
|
||||
description: 3.3.5.8 版本说明
|
||||
---
|
||||
|
||||
## 特性
|
||||
1. 特性:JDBC 支持 ONLY META 订阅
|
||||
2. 特性:Grafana 插件 SQL 编辑支持多行
|
||||
3. 特性:ODBC 支持 VARBINARY/GEOMETRY 类型
|
||||
4. 特性:支持 Excel 通过 ODBC 驱动连接 TDengine
|
||||
5. 特性:taosX agent 支持指定本地端口
|
||||
|
||||
## 优化
|
||||
1. 优化:WebSocket 连接订阅消息为空时,支持获取错误
|
||||
2. 优化:JDBC 支持无符号整数
|
||||
3. 优化:MQTT/Kafka/CSV 新增写并发参数
|
||||
4. 优化:开源版本 TDengine 支持与 TDgpt 对接
|
||||
5. 优化:Flink 连接器支持 BinaryRowData 数据传输类型
|
||||
6. 优化:参数绑定 SQL 语句中,LIMIT 子句支持使用 ? 作为参数占位符
|
||||
7. 优化:taosX 备份开启 WebSocket 压缩
|
||||
8. 优化:ODBC SQLSetStmtAttr 支持 SQL_ROWSET_SIZE 属性
|
||||
9. 优化:TMQ 数据同步任务新增 Number Of Writters/Consumers 等参数
|
||||
10. 优化:mac 安装包增加连接器文件
|
||||
11. 优化:Rust 连接器支持订阅结果为空时的错误处理
|
||||
12. 优化:TSBS 支持生成 CSV 文件
|
||||
13. 优化:TDinsight 添加连接分类信息
|
||||
14. 优化:Explorer float 显示精度与 taos shell 一致
|
||||
15. 优化:Flink 连接器 Table 支持更新和删除操作
|
||||
16. 优化:taosX Agent 在 taosX 无法连接时可重试恢复
|
||||
|
||||
## 修复
|
||||
1. 修复:Explorer 注册邮箱支持包含 "."
|
||||
2. 修复:AWS 云存储下 taosAdapter flock 失败
|
||||
3. 修复:修改子表中布尔类型标签的值时,数据订阅的元数据返回结果存在错误
|
||||
4. 修复:Explorer 导入 CSV 时列包含空格时预览将失效
|
||||
5. 修复:解决 stmtbind 线程在系统处于空闲状态时 CPU 占用过高的问题
|
||||
6. 修复:数据源任务不再处理数据时健康状态恢复为 Idle
|
||||
7. 修复:JDBC 示例代码安全漏洞
|
||||
8. 修复:taosX 平滑升级
|
||||
9. 修复:ODBC 调用 SQLSetConnectAttr 设置 SQL_ATTR_TXN_ISOLATION 时 core
|
||||
10. 修复:received/processed_messages 当前运行指标重启未清零
|
||||
11. 修复:使用 taosX 恢复数据时,若未指定数据库,系统可能崩溃
|
||||
12. 修复:创建数据库时,keep_time_offset 选项支持使用后缀 h和 d 来指定时间值
|
||||
13. 修复:删除流计算时可能的死锁
|
||||
14. 修复:双副本数据库在某个 dnode 断网后写入数据失败的问题
|
||||
15. 修复:查询 information_schema.ins_tables 表时,如果 mnode 的 Leader 发生变更,可能会触发 Sync leader is unreachable 错误
|
||||
16. 修复:数据重新整理后,涉及复合主键的时间过滤查询结果出现错误的问题
|
||||
17. 修复:当主键列的连接条件为非简单等值条件时,可能导致 JOIN 结果出现错误
|
||||
18. 修复:Python WebSocket 连接器 Cusor.fetchmany 接口自定义长度问题
|
||||
19. 修复:Show Grants 命令返回的列数目不正确的问题
|
||||
20. 修复:备份计划未启动时查看备份点列表不符合预期
|
||||
21. 修复:taosX 任务写入中断后未重新启动
|
||||
22. 修复:JDBC select server_version() 结果未释放导致内存持续增长
|
||||
23. 修复:在使用 WHERE tbname IN () 语句时,如果筛选出的子表不属于同一超级表,执行 LAST 查询可能会导致 taosd 崩溃
|
||||
24. 修复:taosd 异常退出并再次启动后,如果未进入数据文件的 WAL 过大,可能导致启动时 oom
|
||||
25. 修复:在使用 interp 插值填充时,如果 select list 中包含字符串常量或字符串标签列,返回的字符串内容可能会出现缺失的情况[#29353](https://github.com/taosdata/TDengine/issues/29353)
|
||||
26. 修复:在超级表上执行 JOIN 查询时,将子查询用作右表可能会导致结果缺失
|
||||
27. 修复:同时使用 DISTINCT 和 ORDER BY 关键字时出现的语法错误问题[#29263](https://github.com/taosdata/TDengine/issues/29263)
|
||||
28. 修复:使用 CAST 函数将浮点数转换为字符串后进行比较时,可能会因精度丢失而导致结果不准确[#29382](https://github.com/taosdata/TDengine/issues/29382)
|
||||
29. 修复:在从 3.3.4 版本升级到 3.3.5 版本后,如果配置的字符集在系统中不存在,taosd 服务将无法正常启动
|
||||
30. 修复:websocket 接口 timing 字段有时为负值
|
||||
31. 修复:taosX 备份任务显示备份点重复
|
||||
32. 修复:配置项 s3BucketName 被误设为全局变量参数,导致文件上传到 S3 失败
|
||||
|
|
@ -17,7 +17,6 @@
|
|||
#define TDENGINE_STREAMMSG_H
|
||||
|
||||
#include "tmsg.h"
|
||||
//#include "trpc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -256,6 +255,14 @@ typedef struct {
|
|||
int32_t tEncodeStreamTaskRunReq(SEncoder* pEncoder, const SStreamTaskRunReq* pReq);
|
||||
int32_t tDecodeStreamTaskRunReq(SDecoder* pDecoder, SStreamTaskRunReq* pReq);
|
||||
|
||||
typedef struct {
|
||||
SMsgHead head;
|
||||
int64_t streamId;
|
||||
} SStreamTaskStopReq;
|
||||
|
||||
int32_t tEncodeStreamTaskStopReq(SEncoder* pEncoder, const SStreamTaskStopReq* pReq);
|
||||
int32_t tDecodeStreamTaskStopReq(SDecoder* pDecoder, SStreamTaskStopReq* pReq);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -39,6 +39,7 @@ typedef enum {
|
|||
STREAM_QUEUE,
|
||||
ARB_QUEUE,
|
||||
STREAM_CTRL_QUEUE,
|
||||
STREAM_LONG_EXEC_QUEUE,
|
||||
QUEUE_MAX,
|
||||
} EQueueType;
|
||||
|
||||
|
|
|
@ -401,6 +401,7 @@
|
|||
TD_DEF_MSG_TYPE(TDMT_VND_STREAM_TASK_CHECK, "vnode-stream-task-check", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_STREAM_UNUSED, "vnd-stream-unused", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_GET_STREAM_PROGRESS, "vnd-stream-progress", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_STREAM_ALL_STOP, "vnd-stream-allstop", NULL, NULL)
|
||||
TD_CLOSE_MSG_SEG(TDMT_VND_STREAM_MSG)
|
||||
|
||||
TD_NEW_MSG_SEG(TDMT_VND_TMQ_MSG) //8 << 8
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
// message process
|
||||
int32_t tqStreamTaskStartAsync(SStreamMeta* pMeta, SMsgCb* cb, bool restart);
|
||||
int32_t tqStreamStartOneTaskAsync(SStreamMeta* pMeta, SMsgCb* cb, int64_t streamId, int32_t taskId);
|
||||
int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pMsg, bool restored);
|
||||
int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pMsg, bool restored, bool isLeader);
|
||||
int32_t tqStreamTaskProcessDispatchReq(SStreamMeta* pMeta, SRpcMsg* pMsg);
|
||||
int32_t tqStreamTaskProcessDispatchRsp(SStreamMeta* pMeta, SRpcMsg* pMsg);
|
||||
int32_t tqStreamTaskProcessRetrieveReq(SStreamMeta* pMeta, SRpcMsg* pMsg);
|
||||
|
@ -39,6 +39,7 @@ int32_t tqStreamTaskProcessRunReq(SStreamMeta* pMeta, SRpcMsg* pMsg, bool isLead
|
|||
int32_t tqStartTaskCompleteCallback(SStreamMeta* pMeta);
|
||||
int32_t tqStreamTasksGetTotalNum(SStreamMeta* pMeta);
|
||||
int32_t tqStreamTaskProcessTaskResetReq(SStreamMeta* pMeta, char* msg);
|
||||
int32_t tqStreamTaskProcessAllTaskStopReq(SStreamMeta* pMeta, SMsgCb* pMsgCb, SRpcMsg* pMsg);
|
||||
int32_t tqStreamTaskProcessRetrieveTriggerReq(SStreamMeta* pMeta, SRpcMsg* pMsg);
|
||||
int32_t tqStreamTaskProcessRetrieveTriggerRsp(SStreamMeta* pMeta, SRpcMsg* pMsg);
|
||||
int32_t tqStreamTaskProcessTaskPauseReq(SStreamMeta* pMeta, char* pMsg);
|
||||
|
|
|
@ -183,7 +183,7 @@ void qCleanExecTaskBlockBuf(qTaskInfo_t tinfo);
|
|||
*/
|
||||
int32_t qAsyncKillTask(qTaskInfo_t tinfo, int32_t rspCode);
|
||||
|
||||
int32_t qKillTask(qTaskInfo_t tinfo, int32_t rspCode);
|
||||
int32_t qKillTask(qTaskInfo_t tinfo, int32_t rspCode, int64_t waitDuration);
|
||||
|
||||
bool qTaskIsExecuting(qTaskInfo_t qinfo);
|
||||
|
||||
|
|
|
@ -347,10 +347,10 @@ typedef int32_t (*TScriptCloseFunc)();
|
|||
extern int32_t udfDebugFlag;
|
||||
#define udfFatal(...) { if (udfDebugFlag & 1) { taosPrintLog("UDF FATAL ", 1, 255, __VA_ARGS__); }}
|
||||
#define udfError(...) { if (udfDebugFlag & 1) { taosPrintLog("UDF ERROR ", 1, 255, __VA_ARGS__); }}
|
||||
#define udfWarn(...) { if (udfDebugFlag & 2) { taosPrintLog("UDF WARN ", 2, 255, __VA_ARGS__); }}
|
||||
#define udfInfo(...) { if (udfDebugFlag & 2) { taosPrintLog("UDF ", 2, 255, __VA_ARGS__); }}
|
||||
#define udfDebug(...) { if (udfDebugFlag & 4) { taosPrintLog("UDF ", 4, udfDebugFlag, __VA_ARGS__); }}
|
||||
#define udfTrace(...) { if (udfDebugFlag & 8) { taosPrintLog("UDF ", 8, udfDebugFlag, __VA_ARGS__); }}
|
||||
#define udfWarn(...) { if (udfDebugFlag & 2) { taosPrintLog("UDF WARN ", 2, 255, __VA_ARGS__); }}
|
||||
#define udfInfo(...) { if (udfDebugFlag & 2) { taosPrintLog("UDF INFO ", 2, 255, __VA_ARGS__); }}
|
||||
#define udfDebug(...) { if (udfDebugFlag & 4) { taosPrintLog("UDF DEBUG ", 4, udfDebugFlag, __VA_ARGS__); }}
|
||||
#define udfTrace(...) { if (udfDebugFlag & 8) { taosPrintLog("UDF TRACE ", 8, udfDebugFlag, __VA_ARGS__); }}
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
|
|
|
@ -409,48 +409,16 @@ void* getTaskPoolWorkerCb();
|
|||
#define IS_AUDIT_CTB_NAME(_ctbname) \
|
||||
((*(_ctbname) == 't') && (0 == strncmp(_ctbname, TSDB_AUDIT_CTB_OPERATION, TSDB_AUDIT_CTB_OPERATION_LEN)))
|
||||
|
||||
#define qFatal(...) \
|
||||
do { \
|
||||
if (qDebugFlag & DEBUG_FATAL) { \
|
||||
taosPrintLog("QRY FATAL ", DEBUG_FATAL, tsLogEmbedded ? 255 : qDebugFlag, __VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
#define qError(...) \
|
||||
do { \
|
||||
if (qDebugFlag & DEBUG_ERROR) { \
|
||||
taosPrintLog("QRY ERROR ", DEBUG_ERROR, tsLogEmbedded ? 255 : qDebugFlag, __VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
#define qWarn(...) \
|
||||
do { \
|
||||
if (qDebugFlag & DEBUG_WARN) { \
|
||||
taosPrintLog("QRY WARN ", DEBUG_WARN, tsLogEmbedded ? 255 : qDebugFlag, __VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
#define qInfo(...) \
|
||||
do { \
|
||||
if (qDebugFlag & DEBUG_INFO) { \
|
||||
taosPrintLog("QRY ", DEBUG_INFO, tsLogEmbedded ? 255 : qDebugFlag, __VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
#define qDebug(...) \
|
||||
do { \
|
||||
if (qDebugFlag & DEBUG_DEBUG) { \
|
||||
taosPrintLog("QRY ", DEBUG_DEBUG, qDebugFlag, __VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
#define qTrace(...) \
|
||||
do { \
|
||||
if (qDebugFlag & DEBUG_TRACE) { \
|
||||
taosPrintLog("QRY ", DEBUG_TRACE, qDebugFlag, __VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
#define qDebugL(...) \
|
||||
do { \
|
||||
if (qDebugFlag & DEBUG_DEBUG) { \
|
||||
taosPrintLongString("QRY ", DEBUG_DEBUG, qDebugFlag, __VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
// clang-format off
|
||||
#define qFatal(...) do { if (qDebugFlag & DEBUG_FATAL) { taosPrintLog("QRY FATAL ", DEBUG_FATAL, tsLogEmbedded ? 255 : qDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define qError(...) do { if (qDebugFlag & DEBUG_ERROR) { taosPrintLog("QRY ERROR ", DEBUG_ERROR, tsLogEmbedded ? 255 : qDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define qWarn(...) do { if (qDebugFlag & DEBUG_WARN) { taosPrintLog("QRY WARN ", DEBUG_WARN, tsLogEmbedded ? 255 : qDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define qInfo(...) do { if (qDebugFlag & DEBUG_INFO) { taosPrintLog("QRY INFO ", DEBUG_INFO, tsLogEmbedded ? 255 : qDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define qDebug(...) do { if (qDebugFlag & DEBUG_DEBUG) { taosPrintLog("QRY DEBUG ", DEBUG_DEBUG, qDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define qTrace(...) do { if (qDebugFlag & DEBUG_TRACE) { taosPrintLog("QRY TRACE ", DEBUG_TRACE, qDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define qDebugL(...)do { if (qDebugFlag & DEBUG_DEBUG) { taosPrintLongString("QRY DEBUG ", DEBUG_DEBUG, qDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define qInfoL(...) do { if (qDebugFlag & DEBUG_INFO) { taosPrintLongString("QRY INFO ", DEBUG_INFO, tsLogEmbedded ? 255 : qDebugFlag, __VA_ARGS__); }} while(0)
|
||||
// clang-format on
|
||||
|
||||
#define QRY_ERR_RET(c) \
|
||||
do { \
|
||||
|
|
|
@ -58,6 +58,7 @@ extern "C" {
|
|||
#define STREAM_EXEC_T_STOP_ALL_TASKS (-5)
|
||||
#define STREAM_EXEC_T_RESUME_TASK (-6)
|
||||
#define STREAM_EXEC_T_ADD_FAILED_TASK (-7)
|
||||
#define STREAM_EXEC_T_STOP_ONE_TASK (-8)
|
||||
|
||||
typedef struct SStreamTask SStreamTask;
|
||||
typedef struct SStreamQueue SStreamQueue;
|
||||
|
@ -140,6 +141,7 @@ enum {
|
|||
STREAM_QUEUE__SUCESS = 1,
|
||||
STREAM_QUEUE__FAILED,
|
||||
STREAM_QUEUE__PROCESSING,
|
||||
STREAM_QUEUE__CHKPTFAILED,
|
||||
};
|
||||
|
||||
typedef enum EStreamTaskEvent {
|
||||
|
@ -498,8 +500,10 @@ typedef struct STaskUpdateInfo {
|
|||
} STaskUpdateInfo;
|
||||
|
||||
typedef struct SScanWalInfo {
|
||||
int32_t scanCounter;
|
||||
int32_t scanSentinel;
|
||||
tmr_h scanTimer;
|
||||
int64_t lastScanTs;
|
||||
int32_t tickCounter;
|
||||
} SScanWalInfo;
|
||||
|
||||
typedef struct SFatalErrInfo {
|
||||
|
@ -768,15 +772,19 @@ void streamMetaCleanup();
|
|||
int32_t streamMetaOpen(const char* path, void* ahandle, FTaskBuild expandFunc, FTaskExpand expandTaskFn, int32_t vgId,
|
||||
int64_t stage, startComplete_fn_t fn, SStreamMeta** pMeta);
|
||||
void streamMetaClose(SStreamMeta* streamMeta);
|
||||
int32_t streamMetaSaveTask(SStreamMeta* pMeta, SStreamTask* pTask); // save to stream meta store
|
||||
int32_t streamMetaRemoveTask(SStreamMeta* pMeta, STaskId* pKey);
|
||||
|
||||
int32_t streamMetaSaveTaskInMeta(SStreamMeta* pMeta, SStreamTask* pTask); // save to stream meta store
|
||||
int32_t streamMetaRemoveTaskInMeta(SStreamMeta* pMeta, STaskId* pKey);
|
||||
|
||||
int32_t streamMetaRegisterTask(SStreamMeta* pMeta, int64_t ver, SStreamTask* pTask, bool* pAdded);
|
||||
int32_t streamMetaUnregisterTask(SStreamMeta* pMeta, int64_t streamId, int32_t taskId);
|
||||
int32_t streamMetaGetNumOfTasks(SStreamMeta* pMeta);
|
||||
|
||||
int32_t streamMetaAcquireTaskNoLock(SStreamMeta* pMeta, int64_t streamId, int32_t taskId, SStreamTask** pTask);
|
||||
int32_t streamMetaAcquireTaskUnsafe(SStreamMeta* pMeta, STaskId* pId, SStreamTask** pTask);
|
||||
int32_t streamMetaAcquireTask(SStreamMeta* pMeta, int64_t streamId, int32_t taskId, SStreamTask** pTask);
|
||||
void streamMetaReleaseTask(SStreamMeta* pMeta, SStreamTask* pTask);
|
||||
|
||||
void streamMetaClear(SStreamMeta* pMeta);
|
||||
void streamMetaInitBackend(SStreamMeta* pMeta);
|
||||
int32_t streamMetaCommit(SStreamMeta* pMeta);
|
||||
|
@ -797,6 +805,7 @@ void streamMetaClearSetUpdateTaskListComplete(SStreamMeta* pMeta);
|
|||
bool streamMetaInitUpdateTaskList(SStreamMeta* pMeta, int32_t transId);
|
||||
|
||||
void streamMetaRLock(SStreamMeta* pMeta);
|
||||
int32_t streamMetaTryRlock(SStreamMeta* pMeta);
|
||||
void streamMetaRUnLock(SStreamMeta* pMeta);
|
||||
void streamMetaWLock(SStreamMeta* pMeta);
|
||||
void streamMetaWUnLock(SStreamMeta* pMeta);
|
||||
|
@ -810,6 +819,7 @@ void streamMetaLoadAllTasks(SStreamMeta* pMeta);
|
|||
int32_t streamMetaStartAllTasks(SStreamMeta* pMeta);
|
||||
int32_t streamMetaStopAllTasks(SStreamMeta* pMeta);
|
||||
int32_t streamMetaStartOneTask(SStreamMeta* pMeta, int64_t streamId, int32_t taskId);
|
||||
int32_t streamMetaStopOneTask(SStreamMeta* pMeta, int64_t streamId, int32_t taskId);
|
||||
bool streamMetaAllTasksReady(const SStreamMeta* pMeta);
|
||||
int32_t streamTaskSendNegotiateChkptIdMsg(SStreamTask* pTask);
|
||||
int32_t streamTaskCheckIfReqConsenChkptId(SStreamTask* pTask, int64_t ts);
|
||||
|
|
|
@ -128,18 +128,19 @@ bool reportThreadSetQuit();
|
|||
void writeCrashLogToFile(int signum, void *sigInfo, char *nodeType, int64_t clusterId, int64_t startTime);
|
||||
|
||||
// clang-format off
|
||||
#define uFatal(...) { if (uDebugFlag & DEBUG_FATAL) { taosPrintLog("UTL FATAL", DEBUG_FATAL, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||
#define uFatal(...) { if (uDebugFlag & DEBUG_FATAL) { taosPrintLog("UTL FATAL ", DEBUG_FATAL, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||
#define uError(...) { if (uDebugFlag & DEBUG_ERROR) { taosPrintLog("UTL ERROR ", DEBUG_ERROR, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||
#define uWarn(...) { if (uDebugFlag & DEBUG_WARN) { taosPrintLog("UTL WARN ", DEBUG_WARN, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||
#define uInfo(...) { if (uDebugFlag & DEBUG_INFO) { taosPrintLog("UTL ", DEBUG_INFO, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||
#define uDebug(...) { if (uDebugFlag & DEBUG_DEBUG) { taosPrintLog("UTL ", DEBUG_DEBUG, uDebugFlag, __VA_ARGS__); }}
|
||||
#define uTrace(...) { if (uDebugFlag & DEBUG_TRACE) { taosPrintLog("UTL ", DEBUG_TRACE, uDebugFlag, __VA_ARGS__); }}
|
||||
#define uDebugL(...){ if (uDebugFlag & DEBUG_DEBUG) { taosPrintLongString("UTL ", DEBUG_DEBUG, uDebugFlag, __VA_ARGS__); }}
|
||||
#define uInfoL(...) { if (uDebugFlag & DEBUG_INFO) { taosPrintLongString("UTL ", DEBUG_INFO, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||
#define uWarn(...) { if (uDebugFlag & DEBUG_WARN) { taosPrintLog("UTL WARN ", DEBUG_WARN, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||
#define uInfo(...) { if (uDebugFlag & DEBUG_INFO) { taosPrintLog("UTL INFO ", DEBUG_INFO, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||
#define uDebug(...) { if (uDebugFlag & DEBUG_DEBUG) { taosPrintLog("UTL DEBUG ", DEBUG_DEBUG, uDebugFlag, __VA_ARGS__); }}
|
||||
#define uTrace(...) { if (uDebugFlag & DEBUG_TRACE) { taosPrintLog("UTL TRACE ", DEBUG_TRACE, uDebugFlag, __VA_ARGS__); }}
|
||||
#define uDebugL(...){ if (uDebugFlag & DEBUG_DEBUG) { taosPrintLongString("UTL DEBUG ", DEBUG_DEBUG, uDebugFlag, __VA_ARGS__); }}
|
||||
#define uInfoL(...) { if (uDebugFlag & DEBUG_INFO) { taosPrintLongString("UTL INFO ", DEBUG_INFO, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||
|
||||
#define pError(...) { taosPrintLog("APP ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }
|
||||
#define pPrint(...) { taosPrintLog("APP ", DEBUG_INFO, 255, __VA_ARGS__); }
|
||||
#define pPrint(...) { taosPrintLog("APP INFO ", DEBUG_INFO, 255, __VA_ARGS__); }
|
||||
// clang-format on
|
||||
|
||||
// #define BUF_PAGE_DEBUG
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ void tQWorkerFreeQueue(SQWorkerPool *pool, STaosQueue *queue);
|
|||
|
||||
int32_t tAutoQWorkerInit(SAutoQWorkerPool *pool);
|
||||
void tAutoQWorkerCleanup(SAutoQWorkerPool *pool);
|
||||
STaosQueue *tAutoQWorkerAllocQueue(SAutoQWorkerPool *pool, void *ahandle, FItem fp);
|
||||
STaosQueue *tAutoQWorkerAllocQueue(SAutoQWorkerPool *pool, void *ahandle, FItem fp, int32_t minNum);
|
||||
void tAutoQWorkerFreeQueue(SAutoQWorkerPool *pool, STaosQueue *queue);
|
||||
|
||||
int32_t tWWorkerInit(SWWorkerPool *pool);
|
||||
|
|
|
@ -8,18 +8,44 @@ ARG cpuType
|
|||
RUN echo ${pkgFile} && echo ${dirName}
|
||||
|
||||
COPY ${pkgFile} /root/
|
||||
|
||||
ENV TINI_VERSION v0.19.0
|
||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${cpuType} /tini
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
WORKDIR /root/
|
||||
RUN tar -zxf ${pkgFile} && cd /root/${dirName}/ && /bin/bash install.sh -e no && cd /root && rm /root/${pkgFile} && rm -rf /root/${dirName} && apt-get update && apt-get install -y locales tzdata netcat curl gdb vim tmux less net-tools valgrind && locale-gen en_US.UTF-8 && apt-get clean && rm -rf /var/lib/apt/lists/ && chmod +x /tini
|
||||
|
||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${cpuType} /tini
|
||||
RUN chmod +x /tini
|
||||
|
||||
RUN tar -zxf /root/${pkgFile} && \
|
||||
cd /root/${dirName}/ && \
|
||||
/bin/bash /root/${dirName}/install.sh -e no && \
|
||||
cd /root/ && \
|
||||
rm /root/${pkgFile} && \
|
||||
rm -rf /root/${dirName} && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
locales \
|
||||
tzdata \
|
||||
netcat \
|
||||
curl \
|
||||
gdb \
|
||||
vim \
|
||||
tmux \
|
||||
less \
|
||||
net-tools \
|
||||
valgrind \
|
||||
rsync && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
locale-gen en_US.UTF-8
|
||||
|
||||
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib" \
|
||||
LC_CTYPE=en_US.UTF-8 \
|
||||
LANG=en_US.UTF-8 \
|
||||
LC_ALL=en_US.UTF-8
|
||||
|
||||
COPY ./bin/* /usr/bin/
|
||||
|
||||
ENTRYPOINT ["/tini", "--", "/usr/bin/entrypoint.sh"]
|
||||
CMD ["taosd"]
|
||||
|
||||
VOLUME [ "/var/lib/taos", "/var/log/taos", "/corefile" ]
|
||||
|
|
|
@ -25,14 +25,14 @@ extern "C" {
|
|||
// clang-format off
|
||||
#define tscFatal(...) do { if (cDebugFlag & DEBUG_FATAL) { taosPrintLog("TSC FATAL ", DEBUG_FATAL, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscError(...) do { if (cDebugFlag & DEBUG_ERROR) { taosPrintLog("TSC ERROR ", DEBUG_ERROR, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscWarn(...) do { if (cDebugFlag & DEBUG_WARN) { taosPrintLog("TSC WARN ", DEBUG_WARN, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscInfo(...) do { if (cDebugFlag & DEBUG_INFO) { taosPrintLog("TSC INFO ", DEBUG_INFO, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscDebug(...) do { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLog("TSC DEBUG ", DEBUG_DEBUG, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscTrace(...) do { if (cDebugFlag & DEBUG_TRACE) { taosPrintLog("TSC TRACE ", DEBUG_TRACE, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscPerf(...) do { if (cDebugFlag & DEBUG_INFO) { taosPrintLog("TSC PERF ", 0, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscErrorL(...) do { if (cDebugFlag & DEBUG_ERROR) { taosPrintLongString("TSC ERROR ", DEBUG_ERROR, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscWarn(...) do { if (cDebugFlag & DEBUG_WARN) { taosPrintLog("TSC WARN ", DEBUG_WARN, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscWarnL(...) do { if (cDebugFlag & DEBUG_WARN) { taosPrintLongString("TSC WARN ", DEBUG_WARN, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscInfo(...) do { if (cDebugFlag & DEBUG_INFO) { taosPrintLog("TSC ", DEBUG_INFO, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscDebug(...) do { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLog("TSC ", DEBUG_DEBUG, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscTrace(...) do { if (cDebugFlag & DEBUG_TRACE) { taosPrintLog("TSC ", DEBUG_TRACE, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscDebugL(...) do { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLongString("TSC ", DEBUG_DEBUG, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscPerf(...) do { if (cDebugFlag & DEBUG_INFO) { taosPrintLog("TSC ", 0, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscWarnL(...) do { if (cDebugFlag & DEBUG_WARN) { taosPrintLongString("TSC WARN ", DEBUG_WARN, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscDebugL(...) do { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLongString("TSC DEBUG ", DEBUG_DEBUG, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tscLog(...) do { taosPrintLog("TSC ", 0, DEBUG_FILE, __VA_ARGS__); } while(0)
|
||||
#define tscLogL(...) do { taosPrintLongString("TSC ", 0, DEBUG_FILE, __VA_ARGS__); } while(0)
|
||||
// clang-format on
|
||||
|
|
|
@ -205,12 +205,12 @@ extern char *gStmtStatusStr[];
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
#define STMT_FLOG(param, ...) qFatal("stmt:%p " param, pStmt, __VA_ARGS__)
|
||||
#define STMT_ELOG(param, ...) qError("stmt:%p " param, pStmt, __VA_ARGS__)
|
||||
#define STMT_DLOG(param, ...) qDebug("stmt:%p " param, pStmt, __VA_ARGS__)
|
||||
#define STMT_FLOG(param, ...) qFatal("stmt:%p, " param, pStmt, __VA_ARGS__)
|
||||
#define STMT_ELOG(param, ...) qError("stmt:%p, " param, pStmt, __VA_ARGS__)
|
||||
#define STMT_DLOG(param, ...) qDebug("stmt:%p, " param, pStmt, __VA_ARGS__)
|
||||
|
||||
#define STMT_ELOG_E(param) qError("stmt:%p " param, pStmt)
|
||||
#define STMT_DLOG_E(param) qDebug("stmt:%p " param, pStmt)
|
||||
#define STMT_ELOG_E(param) qError("stmt:%p, " param, pStmt)
|
||||
#define STMT_DLOG_E(param) qDebug("stmt:%p, " param, pStmt)
|
||||
|
||||
TAOS_STMT *stmtInit(STscObj* taos, int64_t reqid, TAOS_STMT_OPTIONS* pOptions);
|
||||
int stmtClose(TAOS_STMT *stmt);
|
||||
|
|
|
@ -222,12 +222,12 @@ do { \
|
|||
} while (0)
|
||||
|
||||
|
||||
#define STMT_FLOG(param, ...) qFatal("stmt:%p " param, pStmt, __VA_ARGS__)
|
||||
#define STMT_ELOG(param, ...) qError("stmt:%p " param, pStmt, __VA_ARGS__)
|
||||
#define STMT_DLOG(param, ...) qDebug("stmt:%p " param, pStmt, __VA_ARGS__)
|
||||
#define STMT_FLOG(param, ...) qFatal("stmt:%p, " param, pStmt, __VA_ARGS__)
|
||||
#define STMT_ELOG(param, ...) qError("stmt:%p, " param, pStmt, __VA_ARGS__)
|
||||
#define STMT_DLOG(param, ...) qDebug("stmt:%p, " param, pStmt, __VA_ARGS__)
|
||||
|
||||
#define STMT_ELOG_E(param) qError("stmt:%p " param, pStmt)
|
||||
#define STMT_DLOG_E(param) qDebug("stmt:%p " param, pStmt)
|
||||
#define STMT_ELOG_E(param) qError("stmt:%p, " param, pStmt)
|
||||
#define STMT_DLOG_E(param) qDebug("stmt:%p, " param, pStmt)
|
||||
*/
|
||||
TAOS_STMT2 *stmtInit2(STscObj *taos, TAOS_STMT2_OPTION *pOptions);
|
||||
int stmtClose2(TAOS_STMT2 *stmt);
|
||||
|
|
|
@ -22,42 +22,14 @@
|
|||
#ifndef TDENGINE_JNICOMMON_H
|
||||
#define TDENGINE_JNICOMMON_H
|
||||
|
||||
#define jniFatal(...) \
|
||||
{ \
|
||||
if (jniDebugFlag & DEBUG_FATAL) { \
|
||||
taosPrintLog("JNI FATAL ", DEBUG_FATAL, jniDebugFlag, __VA_ARGS__); \
|
||||
} \
|
||||
}
|
||||
#define jniError(...) \
|
||||
{ \
|
||||
if (jniDebugFlag & DEBUG_ERROR) { \
|
||||
taosPrintLog("JNI ERROR ", DEBUG_ERROR, jniDebugFlag, __VA_ARGS__); \
|
||||
} \
|
||||
}
|
||||
#define jniWarn(...) \
|
||||
{ \
|
||||
if (jniDebugFlag & DEBUG_WARN) { \
|
||||
taosPrintLog("JNI WARN ", DEBUG_WARN, jniDebugFlag, __VA_ARGS__); \
|
||||
} \
|
||||
}
|
||||
#define jniInfo(...) \
|
||||
{ \
|
||||
if (jniDebugFlag & DEBUG_INFO) { \
|
||||
taosPrintLog("JNI ", DEBUG_INFO, jniDebugFlag, __VA_ARGS__); \
|
||||
} \
|
||||
}
|
||||
#define jniDebug(...) \
|
||||
{ \
|
||||
if (jniDebugFlag & DEBUG_DEBUG) { \
|
||||
taosPrintLog("JNI ", DEBUG_DEBUG, jniDebugFlag, __VA_ARGS__); \
|
||||
} \
|
||||
}
|
||||
#define jniTrace(...) \
|
||||
{ \
|
||||
if (jniDebugFlag & DEBUG_TRACE) { \
|
||||
taosPrintLog("JNI ", DEBUG_TRACE, jniDebugFlag, __VA_ARGS__); \
|
||||
} \
|
||||
}
|
||||
// clang-format off
|
||||
#define jniFatal(...) do { if (jniDebugFlag & DEBUG_FATAL) { taosPrintLog("JNI FATAL ", DEBUG_FATAL, jniDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define jniError(...) do { if (jniDebugFlag & DEBUG_ERROR) { taosPrintLog("JNI ERROR ", DEBUG_ERROR, jniDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define jniWarn(...) do { if (jniDebugFlag & DEBUG_WARN) { taosPrintLog("JNI WARN ", DEBUG_WARN, jniDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define jniInfo(...) do { if (jniDebugFlag & DEBUG_INFO) { taosPrintLog("JNI INFO ", DEBUG_INFO, jniDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define jniDebug(...) do { if (jniDebugFlag & DEBUG_DEBUG) { taosPrintLog("JNI DEBUG ", DEBUG_DEBUG, jniDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define jniTrace(...) do { if (jniDebugFlag & DEBUG_TRACE) { taosPrintLog("JNI TRACE ", DEBUG_TRACE, jniDebugFlag, __VA_ARGS__); }} while(0)
|
||||
// clang-format on
|
||||
|
||||
extern jclass g_arrayListClass;
|
||||
extern jmethodID g_arrayListConstructFp;
|
||||
|
|
|
@ -93,8 +93,7 @@ static int32_t registerRequest(SRequestObj *pRequest, STscObj *pTscObj) {
|
|||
|
||||
int32_t total = atomic_add_fetch_64((int64_t *)&pSummary->totalRequests, 1);
|
||||
int32_t currentInst = atomic_add_fetch_64((int64_t *)&pSummary->currentRequests, 1);
|
||||
tscDebug("0x%" PRIx64 " new Request from connObj:0x%" PRIx64
|
||||
", current:%d, app current:%d, total:%d,QID:0x%" PRIx64,
|
||||
tscDebug("req:0x%" PRIx64 ", new from connObj:0x%" PRIx64 ", current:%d, app current:%d, total:%d, QID:0x%" PRIx64,
|
||||
pRequest->self, pRequest->pTscObj->id, num, currentInst, total, pRequest->requestId);
|
||||
}
|
||||
|
||||
|
@ -134,7 +133,7 @@ static int32_t generateWriteSlowLog(STscObj *pTscObj, SRequestObj *pRequest, int
|
|||
cJSON *json = cJSON_CreateObject();
|
||||
int32_t code = TSDB_CODE_SUCCESS;
|
||||
if (json == NULL) {
|
||||
tscError("[monitor] cJSON_CreateObject failed");
|
||||
tscError("failed to create monitor json");
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
}
|
||||
char clusterId[32] = {0};
|
||||
|
@ -255,26 +254,25 @@ static void deregisterRequest(SRequestObj *pRequest) {
|
|||
int32_t reqType = SLOW_LOG_TYPE_OTHERS;
|
||||
|
||||
int64_t duration = taosGetTimestampUs() - pRequest->metric.start;
|
||||
tscDebug("0x%" PRIx64 " free Request from connObj: 0x%" PRIx64 ",QID:0x%" PRIx64
|
||||
" elapsed:%.2f ms, "
|
||||
"current:%d, app current:%d",
|
||||
tscDebug("req:0x%" PRIx64 ", free from connObj:0x%" PRIx64 ", QID:0x%" PRIx64
|
||||
", elapsed:%.2f ms, current:%d, app current:%d",
|
||||
pRequest->self, pTscObj->id, pRequest->requestId, duration / 1000.0, num, currentInst);
|
||||
|
||||
if (TSDB_CODE_SUCCESS == nodesSimAcquireAllocator(pRequest->allocatorRefId)) {
|
||||
if ((pRequest->pQuery && pRequest->pQuery->pRoot && QUERY_NODE_VNODE_MODIFY_STMT == pRequest->pQuery->pRoot->type &&
|
||||
(0 == ((SVnodeModifyOpStmt *)pRequest->pQuery->pRoot)->sqlNodeType)) ||
|
||||
QUERY_NODE_VNODE_MODIFY_STMT == pRequest->stmtType) {
|
||||
tscDebug("insert duration %" PRId64 "us: parseCost:%" PRId64 "us, ctgCost:%" PRId64 "us, analyseCost:%" PRId64
|
||||
"us, planCost:%" PRId64 "us, exec:%" PRId64 "us",
|
||||
duration, pRequest->metric.parseCostUs, pRequest->metric.ctgCostUs, pRequest->metric.analyseCostUs,
|
||||
pRequest->metric.planCostUs, pRequest->metric.execCostUs);
|
||||
tscDebug("req:0x%" PRIx64 ", insert duration:%" PRId64 "us, parseCost:%" PRId64 "us, ctgCost:%" PRId64
|
||||
"us, analyseCost:%" PRId64 "us, planCost:%" PRId64 "us, exec:%" PRId64 "us",
|
||||
pRequest->self, duration, pRequest->metric.parseCostUs, pRequest->metric.ctgCostUs,
|
||||
pRequest->metric.analyseCostUs, pRequest->metric.planCostUs, pRequest->metric.execCostUs);
|
||||
(void)atomic_add_fetch_64((int64_t *)&pActivity->insertElapsedTime, duration);
|
||||
reqType = SLOW_LOG_TYPE_INSERT;
|
||||
} else if (QUERY_NODE_SELECT_STMT == pRequest->stmtType) {
|
||||
tscDebug("query duration %" PRId64 "us: parseCost:%" PRId64 "us, ctgCost:%" PRId64 "us, analyseCost:%" PRId64
|
||||
"us, planCost:%" PRId64 "us, exec:%" PRId64 "us",
|
||||
duration, pRequest->metric.parseCostUs, pRequest->metric.ctgCostUs, pRequest->metric.analyseCostUs,
|
||||
pRequest->metric.planCostUs, pRequest->metric.execCostUs);
|
||||
tscDebug("req:0x%" PRIx64 ", query duration:%" PRId64 "us, parseCost:%" PRId64 "us, ctgCost:%" PRId64
|
||||
"us, analyseCost:%" PRId64 "us, planCost:%" PRId64 "us, exec:%" PRId64 "us",
|
||||
pRequest->self, duration, pRequest->metric.parseCostUs, pRequest->metric.ctgCostUs,
|
||||
pRequest->metric.analyseCostUs, pRequest->metric.planCostUs, pRequest->metric.execCostUs);
|
||||
|
||||
(void)atomic_add_fetch_64((int64_t *)&pActivity->queryElapsedTime, duration);
|
||||
reqType = SLOW_LOG_TYPE_QUERY;
|
||||
|
@ -299,7 +297,7 @@ static void deregisterRequest(SRequestObj *pRequest) {
|
|||
checkSlowLogExceptDb(pRequest, pTscObj->pAppInfo->serverCfg.monitorParas.tsSlowLogExceptDb)) {
|
||||
(void)atomic_add_fetch_64((int64_t *)&pActivity->numOfSlowQueries, 1);
|
||||
if (pTscObj->pAppInfo->serverCfg.monitorParas.tsSlowLogScope & reqType) {
|
||||
taosPrintSlowLog("PID:%d, Conn:%u,QID:0x%" PRIx64 ", Start:%" PRId64 " us, Duration:%" PRId64 "us, SQL:%s",
|
||||
taosPrintSlowLog("PID:%d, connId:%u, QID:0x%" PRIx64 ", Start:%" PRId64 "us, Duration:%" PRId64 "us, SQL:%s",
|
||||
taosGetPId(), pTscObj->connId, pRequest->requestId, pRequest->metric.start, duration,
|
||||
pRequest->sqlstr);
|
||||
if (pTscObj->pAppInfo->serverCfg.monitorParas.tsEnableMonitor) {
|
||||
|
@ -460,7 +458,7 @@ void destroyTscObj(void *pObj) {
|
|||
|
||||
STscObj *pTscObj = pObj;
|
||||
int64_t tscId = pTscObj->id;
|
||||
tscTrace("begin to destroy tscObj %" PRIx64 " p:%p", tscId, pTscObj);
|
||||
tscTrace("connObj:%" PRIx64 ", begin destroy, p:%p", tscId, pTscObj);
|
||||
|
||||
SClientHbKey connKey = {.tscRid = pTscObj->id, .connType = pTscObj->connType};
|
||||
hbDeregisterConn(pTscObj, connKey);
|
||||
|
@ -469,7 +467,7 @@ void destroyTscObj(void *pObj) {
|
|||
taosHashCleanup(pTscObj->pRequests);
|
||||
|
||||
schedulerStopQueryHb(pTscObj->pAppInfo->pTransporter);
|
||||
tscDebug("connObj 0x%" PRIx64 " p:%p destroyed, remain inst totalConn:%" PRId64, pTscObj->id, pTscObj,
|
||||
tscDebug("connObj:0x%" PRIx64 ", p:%p destroyed, remain inst totalConn:%" PRId64, pTscObj->id, pTscObj,
|
||||
pTscObj->pAppInfo->numOfConns);
|
||||
|
||||
// In any cases, we should not free app inst here. Or an race condition rises.
|
||||
|
@ -478,7 +476,7 @@ void destroyTscObj(void *pObj) {
|
|||
(void)taosThreadMutexDestroy(&pTscObj->mutex);
|
||||
taosMemoryFree(pTscObj);
|
||||
|
||||
tscTrace("end to destroy tscObj %" PRIx64 " p:%p", tscId, pTscObj);
|
||||
tscTrace("connObj:0x%" PRIx64 ", end destroy, p:%p", tscId, pTscObj);
|
||||
}
|
||||
|
||||
int32_t createTscObj(const char *user, const char *auth, const char *db, int32_t connType, SAppInstInfo *pAppInfo,
|
||||
|
@ -518,7 +516,7 @@ int32_t createTscObj(const char *user, const char *auth, const char *db, int32_t
|
|||
|
||||
(void)atomic_add_fetch_64(&(*pObj)->pAppInfo->numOfConns, 1);
|
||||
|
||||
tscDebug("connObj created, 0x%" PRIx64 ",p:%p", (*pObj)->id, *pObj);
|
||||
tscInfo("connObj:0x%" PRIx64 ", created, p:%p", (*pObj)->id, *pObj);
|
||||
return code;
|
||||
}
|
||||
|
||||
|
@ -684,13 +682,13 @@ void doDestroyRequest(void *p) {
|
|||
SRequestObj *pRequest = (SRequestObj *)p;
|
||||
|
||||
uint64_t reqId = pRequest->requestId;
|
||||
tscDebug("begin to destroy request 0x%" PRIx64 " p:%p", reqId, pRequest);
|
||||
tscDebug("QID:0x%" PRIx64 ", begin destroy request, res:%p", reqId, pRequest);
|
||||
|
||||
int64_t nextReqRefId = pRequest->relation.nextRefId;
|
||||
|
||||
int32_t code = taosHashRemove(pRequest->pTscObj->pRequests, &pRequest->self, sizeof(pRequest->self));
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("failed to remove request from hash, code:%s", tstrerror(code));
|
||||
tscDebug("failed to remove request from hash since %s", tstrerror(code));
|
||||
}
|
||||
schedulerFreeJob(&pRequest->body.queryJob, 0);
|
||||
|
||||
|
@ -726,14 +724,12 @@ void doDestroyRequest(void *p) {
|
|||
taosMemoryFreeClear(pRequest->effectiveUser);
|
||||
taosMemoryFreeClear(pRequest->sqlstr);
|
||||
taosMemoryFree(pRequest);
|
||||
tscDebug("end to destroy request %" PRIx64 " p:%p", reqId, pRequest);
|
||||
tscDebug("QID:0x%" PRIx64 ", end destroy request, res:%p", reqId, pRequest);
|
||||
destroyNextReq(nextReqRefId);
|
||||
}
|
||||
|
||||
void destroyRequest(SRequestObj *pRequest) {
|
||||
if (pRequest == NULL) {
|
||||
return;
|
||||
}
|
||||
if (pRequest == NULL) return;
|
||||
|
||||
taos_stop_query(pRequest);
|
||||
(void)removeFromMostPrevReq(pRequest);
|
||||
|
@ -744,12 +740,12 @@ void taosStopQueryImpl(SRequestObj *pRequest) {
|
|||
|
||||
// It is not a query, no need to stop.
|
||||
if (NULL == pRequest->pQuery || QUERY_EXEC_MODE_SCHEDULE != pRequest->pQuery->execMode) {
|
||||
tscDebug("request 0x%" PRIx64 " no need to be killed since not query", pRequest->requestId);
|
||||
tscDebug("QID:0x%" PRIx64 ", no need to be killed since not query", pRequest->requestId);
|
||||
return;
|
||||
}
|
||||
|
||||
schedulerFreeJob(&pRequest->body.queryJob, TSDB_CODE_TSC_QUERY_KILLED);
|
||||
tscDebug("request %" PRIx64 " killed", pRequest->requestId);
|
||||
tscDebug("QID:0x%" PRIx64 ", killed", pRequest->requestId);
|
||||
}
|
||||
|
||||
void stopAllQueries(SRequestObj *pRequest) {
|
||||
|
@ -857,7 +853,7 @@ static void *tscCrashReportThreadFp(void *param) {
|
|||
truncateFile = true;
|
||||
}
|
||||
} else {
|
||||
tscDebug("no crash info");
|
||||
tscInfo("no crash info was found");
|
||||
}
|
||||
|
||||
taosMemoryFree(pMsg);
|
||||
|
@ -985,13 +981,13 @@ void taos_init_imp(void) {
|
|||
return;
|
||||
}
|
||||
|
||||
tscInfo("starting to initialize TAOS driver");
|
||||
|
||||
SCatalogCfg cfg = {.maxDBCacheNum = 100, .maxTblCacheNum = 100};
|
||||
ENV_ERR_RET(catalogInit(&cfg), "failed to init catalog");
|
||||
ENV_ERR_RET(schedulerInit(), "failed to init scheduler");
|
||||
ENV_ERR_RET(initClientId(), "failed to init clientId");
|
||||
|
||||
tscDebug("starting to initialize TAOS driver");
|
||||
|
||||
ENV_ERR_RET(initTaskQueue(), "failed to init task queue");
|
||||
ENV_ERR_RET(fmFuncMgtInit(), "failed to init funcMgt");
|
||||
ENV_ERR_RET(nodesInitAllocatorSet(), "failed to init allocator set");
|
||||
|
@ -1004,7 +1000,7 @@ void taos_init_imp(void) {
|
|||
ENV_ERR_RET(tscCrashReportInit(), "failed to init crash report");
|
||||
ENV_ERR_RET(qInitKeywordsTable(), "failed to init parser keywords table");
|
||||
|
||||
tscDebug("client is initialized successfully");
|
||||
tscInfo("TAOS driver is initialized successfully");
|
||||
}
|
||||
|
||||
int taos_init() {
|
||||
|
|
|
@ -121,7 +121,7 @@ static int32_t hbUpdateUserAuthInfo(SAppHbMgr *pAppHbMgr, SUserAuthBatchRsp *bat
|
|||
pTscObj->authVer = pRsp->version;
|
||||
|
||||
if (pTscObj->sysInfo != pRsp->sysInfo) {
|
||||
tscDebug("update sysInfo of user %s from %" PRIi8 " to %" PRIi8 ", tscRid:%" PRIi64, pRsp->user,
|
||||
tscDebug("update sysInfo of user %s from %" PRIi8 " to %" PRIi8 ", connObj:%" PRIi64, pRsp->user,
|
||||
pTscObj->sysInfo, pRsp->sysInfo, pTscObj->id);
|
||||
pTscObj->sysInfo = pRsp->sysInfo;
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ static int32_t hbUpdateUserAuthInfo(SAppHbMgr *pAppHbMgr, SUserAuthBatchRsp *bat
|
|||
if (passInfo->fp) {
|
||||
(*passInfo->fp)(passInfo->param, &pRsp->passVer, TAOS_NOTIFY_PASSVER);
|
||||
}
|
||||
tscDebug("update passVer of user %s from %d to %d, tscRid:%" PRIi64, pRsp->user, oldVer,
|
||||
tscDebug("update passVer of user %s from %d to %d, connObj:%" PRIi64, pRsp->user, oldVer,
|
||||
atomic_load_32(&passInfo->ver), pTscObj->id);
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ static int32_t hbUpdateUserAuthInfo(SAppHbMgr *pAppHbMgr, SUserAuthBatchRsp *bat
|
|||
if (whiteListInfo->fp) {
|
||||
(*whiteListInfo->fp)(whiteListInfo->param, &pRsp->whiteListVer, TAOS_NOTIFY_WHITELIST_VER);
|
||||
}
|
||||
tscDebug("update whitelist version of user %s from %" PRId64 " to %" PRId64 ", tscRid:%" PRIi64, pRsp->user,
|
||||
tscDebug("update whitelist version of user %s from %" PRId64 " to %" PRId64 ", connObj:%" PRIi64, pRsp->user,
|
||||
oldVer, atomic_load_64(&whiteListInfo->ver), pTscObj->id);
|
||||
}
|
||||
} else {
|
||||
|
@ -156,7 +156,7 @@ static int32_t hbUpdateUserAuthInfo(SAppHbMgr *pAppHbMgr, SUserAuthBatchRsp *bat
|
|||
SWhiteListInfo *whiteListInfo = &pTscObj->whiteListInfo;
|
||||
int64_t oldVer = atomic_load_64(&whiteListInfo->ver);
|
||||
atomic_store_64(&whiteListInfo->ver, pRsp->whiteListVer);
|
||||
tscDebug("update whitelist version of user %s from %" PRId64 " to %" PRId64 ", tscRid:%" PRIi64, pRsp->user,
|
||||
tscDebug("update whitelist version of user %s from %" PRId64 " to %" PRId64 ", connObj:%" PRIi64, pRsp->user,
|
||||
oldVer, atomic_load_64(&whiteListInfo->ver), pTscObj->id);
|
||||
}
|
||||
releaseTscObj(pReq->connKey.tscRid);
|
||||
|
@ -388,11 +388,11 @@ static int32_t hbprocessTSMARsp(void *value, int32_t valueLen, struct SCatalog *
|
|||
STableTSMAInfo *pTsmaInfo = taosArrayGetP(hbRsp.pTsmas, i);
|
||||
|
||||
if (!pTsmaInfo->pFuncs) {
|
||||
tscDebug("hb to remove tsma: %s.%s", pTsmaInfo->dbFName, pTsmaInfo->name);
|
||||
tscDebug("hb to remove tsma:%s.%s", pTsmaInfo->dbFName, pTsmaInfo->name);
|
||||
code = catalogRemoveTSMA(pCatalog, pTsmaInfo);
|
||||
tFreeAndClearTableTSMAInfo(pTsmaInfo);
|
||||
} else {
|
||||
tscDebug("hb to update tsma: %s.%s", pTsmaInfo->dbFName, pTsmaInfo->name);
|
||||
tscDebug("hb to update tsma:%s.%s", pTsmaInfo->dbFName, pTsmaInfo->name);
|
||||
code = catalogUpdateTSMA(pCatalog, &pTsmaInfo);
|
||||
tFreeAndClearTableTSMAInfo(pTsmaInfo);
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ static void hbProcessQueryRspKvs(int32_t kvNum, SArray *pKvs, struct SCatalog *p
|
|||
break;
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS != hbProcessDynViewRsp(kv->value, kv->valueLen, pCatalog)) {
|
||||
tscError("Process dyn view response failed, len: %d, value: %p", kv->valueLen, kv->value);
|
||||
tscError("Process dyn view response failed, len:%d, value:%p", kv->valueLen, kv->value);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -463,7 +463,7 @@ static void hbProcessQueryRspKvs(int32_t kvNum, SArray *pKvs, struct SCatalog *p
|
|||
break;
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS != hbProcessViewInfoRsp(kv->value, kv->valueLen, pCatalog)) {
|
||||
tscError("Process view info response failed, len: %d, value: %p", kv->valueLen, kv->value);
|
||||
tscError("Process view info response failed, len:%d, value:%p", kv->valueLen, kv->value);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -471,10 +471,10 @@ static void hbProcessQueryRspKvs(int32_t kvNum, SArray *pKvs, struct SCatalog *p
|
|||
#endif
|
||||
case HEARTBEAT_KEY_TSMA: {
|
||||
if (kv->valueLen <= 0 || !kv->value) {
|
||||
tscError("Invalid tsma info, len: %d, value: %p", kv->valueLen, kv->value);
|
||||
tscError("Invalid tsma info, len:%d, value:%p", kv->valueLen, kv->value);
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS != hbprocessTSMARsp(kv->value, kv->valueLen, pCatalog)) {
|
||||
tscError("Process tsma info response failed, len: %d, value: %p", kv->valueLen, kv->value);
|
||||
tscError("Process tsma info response failed, len:%d, value:%p", kv->valueLen, kv->value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -512,14 +512,14 @@ static int32_t hbQueryHbRspHandle(SAppHbMgr *pAppHbMgr, SClientHbRsp *pRsp) {
|
|||
pTscObj->pAppInfo->totalDnodes = pRsp->query->totalDnodes;
|
||||
pTscObj->pAppInfo->onlineDnodes = pRsp->query->onlineDnodes;
|
||||
pTscObj->connId = pRsp->query->connId;
|
||||
tscTrace("conn %u hb rsp, dnodes %d/%d", pTscObj->connId, pTscObj->pAppInfo->onlineDnodes,
|
||||
tscTrace("connId:%u, hb rsp, dnodes %d/%d", pTscObj->connId, pTscObj->pAppInfo->onlineDnodes,
|
||||
pTscObj->pAppInfo->totalDnodes);
|
||||
|
||||
if (pRsp->query->killRid) {
|
||||
tscDebug("request rid %" PRIx64 " need to be killed now", pRsp->query->killRid);
|
||||
tscDebug("QID:%" PRIx64 ", need to be killed now", pRsp->query->killRid);
|
||||
SRequestObj *pRequest = acquireRequest(pRsp->query->killRid);
|
||||
if (NULL == pRequest) {
|
||||
tscDebug("request 0x%" PRIx64 " not exist to kill", pRsp->query->killRid);
|
||||
tscDebug("QID:0x%" PRIx64 ", not exist to kill", pRsp->query->killRid);
|
||||
} else {
|
||||
taos_stop_query((TAOS_RES *)pRequest);
|
||||
(void)releaseRequest(pRsp->query->killRid);
|
||||
|
@ -548,7 +548,7 @@ static int32_t hbQueryHbRspHandle(SAppHbMgr *pAppHbMgr, SClientHbRsp *pRsp) {
|
|||
struct SCatalog *pCatalog = NULL;
|
||||
int32_t code = catalogGetHandle(pReq->clusterId, &pCatalog);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
tscWarn("catalogGetHandle failed, clusterId:%" PRIx64 ", error:%s", pReq->clusterId, tstrerror(code));
|
||||
tscWarn("catalogGetHandle failed, clusterId:0x%" PRIx64 ", error:%s", pReq->clusterId, tstrerror(code));
|
||||
} else {
|
||||
hbProcessQueryRspKvs(kvNum, pRsp->info, pCatalog, pAppHbMgr);
|
||||
}
|
||||
|
@ -576,7 +576,7 @@ static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) {
|
|||
int32_t delta = abs(now - pRsp.svrTimestamp);
|
||||
if (delta > timestampDeltaLimit) {
|
||||
code = TSDB_CODE_TIME_UNSYNCED;
|
||||
tscError("time diff: %ds is too big", delta);
|
||||
tscError("time diff:%ds is too big", delta);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -608,7 +608,7 @@ static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) {
|
|||
|
||||
pInst->serverCfg.monitorParas = pRsp.monitorParas;
|
||||
pInst->serverCfg.enableAuditDelete = pRsp.enableAuditDelete;
|
||||
tscDebug("[monitor] paras from hb, clusterId:%" PRIx64 " monitorParas threshold:%d scope:%d", pInst->clusterId,
|
||||
tscDebug("monitor paras from hb, clusterId:0x%" PRIx64 ", threshold:%d scope:%d", pInst->clusterId,
|
||||
pRsp.monitorParas.tsSlowLogThreshold, pRsp.monitorParas.tsSlowLogScope);
|
||||
|
||||
if (rspNum) {
|
||||
|
@ -703,7 +703,7 @@ int32_t hbBuildQueryDesc(SQueryHbReqBasic *hbBasic, STscObj *pObj) {
|
|||
int32_t hbGetQueryBasicInfo(SClientHbKey *connKey, SClientHbReq *req) {
|
||||
STscObj *pTscObj = (STscObj *)acquireTscObj(connKey->tscRid);
|
||||
if (NULL == pTscObj) {
|
||||
tscWarn("tscObj rid %" PRIx64 " not exist", connKey->tscRid);
|
||||
tscWarn("tscObj rid 0x%" PRIx64 " not exist", connKey->tscRid);
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
@ -751,7 +751,7 @@ int32_t hbGetQueryBasicInfo(SClientHbKey *connKey, SClientHbReq *req) {
|
|||
static int32_t hbGetUserAuthInfo(SClientHbKey *connKey, SHbParam *param, SClientHbReq *req) {
|
||||
STscObj *pTscObj = (STscObj *)acquireTscObj(connKey->tscRid);
|
||||
if (!pTscObj) {
|
||||
tscWarn("tscObj rid %" PRIx64 " not exist", connKey->tscRid);
|
||||
tscWarn("tscObj rid 0x%" PRIx64 " not exist", connKey->tscRid);
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
@ -1041,7 +1041,7 @@ int32_t hbGetExpiredTSMAInfo(SClientHbKey *connKey, struct SCatalog *pCatalog, S
|
|||
tsma->version = htonl(tsma->version);
|
||||
}
|
||||
|
||||
tscDebug("hb got %d expred tsmas, valueLen: %lu", tsmaNum, sizeof(STSMAVersion) * tsmaNum);
|
||||
tscDebug("hb got %d expred tsmas, valueLen:%lu", tsmaNum, sizeof(STSMAVersion) * tsmaNum);
|
||||
|
||||
if (!pReq->info) {
|
||||
pReq->info = taosHashInit(64, hbKeyHashFunc, 1, HASH_ENTRY_LOCK);
|
||||
|
@ -1081,33 +1081,33 @@ int32_t hbQueryHbReqHandle(SClientHbKey *connKey, void *param, SClientHbReq *req
|
|||
|
||||
code = hbGetQueryBasicInfo(connKey, req);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
tscWarn("hbGetQueryBasicInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetQueryBasicInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
if (hbParam->reqCnt == 0) {
|
||||
code = catalogGetHandle(hbParam->clusterId, &pCatalog);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
tscWarn("catalogGetHandle failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("catalogGetHandle failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
code = hbGetAppInfo(hbParam->clusterId, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("getAppInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("getAppInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
if (!taosHashGet(clientHbMgr.appHbHash, &hbParam->clusterId, sizeof(hbParam->clusterId))) {
|
||||
code = hbGetExpiredUserInfo(connKey, pCatalog, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetExpiredUserInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetExpiredUserInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
if (clientHbMgr.appHbHash) {
|
||||
code = taosHashPut(clientHbMgr.appHbHash, &hbParam->clusterId, sizeof(uint64_t), NULL, 0);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbQueryHbReqHandle put clusterId failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId,
|
||||
tscWarn("hbQueryHbReqHandle put clusterId failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId,
|
||||
tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
@ -1118,7 +1118,7 @@ int32_t hbQueryHbReqHandle(SClientHbKey *connKey, void *param, SClientHbReq *req
|
|||
if (2 != atomic_load_8(&hbParam->pAppHbMgr->connHbFlag)) {
|
||||
code = hbGetUserAuthInfo(connKey, hbParam, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetUserAuthInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetUserAuthInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
atomic_store_8(&hbParam->pAppHbMgr->connHbFlag, 1);
|
||||
|
@ -1126,32 +1126,32 @@ int32_t hbQueryHbReqHandle(SClientHbKey *connKey, void *param, SClientHbReq *req
|
|||
|
||||
code = hbGetExpiredDBInfo(connKey, pCatalog, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetExpiredDBInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetExpiredDBInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
code = hbGetExpiredStbInfo(connKey, pCatalog, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetExpiredStbInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetExpiredStbInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
#ifdef TD_ENTERPRISE
|
||||
code = hbGetExpiredViewInfo(connKey, pCatalog, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetExpiredViewInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetExpiredViewInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
#endif
|
||||
code = hbGetExpiredTSMAInfo(connKey, pCatalog, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetExpiredTSMAInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetExpiredTSMAInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
} else {
|
||||
code = hbGetAppInfo(hbParam->clusterId, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetAppInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetAppInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
@ -1537,7 +1537,7 @@ int32_t hbMgrInit() {
|
|||
if (old == 1) return 0;
|
||||
|
||||
clientHbMgr.appId = tGenIdPI64();
|
||||
tscDebug("app %" PRIx64 " initialized", clientHbMgr.appId);
|
||||
tscInfo("app initialized, appId:0x%" PRIx64, clientHbMgr.appId);
|
||||
|
||||
clientHbMgr.appSummary = taosHashInit(10, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK);
|
||||
if (NULL == clientHbMgr.appSummary) {
|
||||
|
|
|
@ -171,7 +171,7 @@ int32_t taos_connect_internal(const char* ip, const char* user, const char* pass
|
|||
}
|
||||
p->instKey = key;
|
||||
key = NULL;
|
||||
tscDebug("new app inst mgr %p, user:%s, ip:%s, port:%d", p, user, epSet.epSet.eps[0].fqdn, epSet.epSet.eps[0].port);
|
||||
tscInfo("new app inst mgr:%p, user:%s, ip:%s, port:%d", p, user, epSet.epSet.eps[0].fqdn, epSet.epSet.eps[0].port);
|
||||
|
||||
pInst = &p;
|
||||
} else {
|
||||
|
@ -227,7 +227,7 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param,
|
|||
|
||||
(*pRequest)->sqlstr = taosMemoryMalloc(sqlLen + 1);
|
||||
if ((*pRequest)->sqlstr == NULL) {
|
||||
tscError("0x%" PRIx64 " failed to prepare sql string buffer, %s", (*pRequest)->self, sql);
|
||||
tscError("req:0x%" PRIx64 ", failed to prepare sql string buffer, %s", (*pRequest)->self, sql);
|
||||
destroyRequest(*pRequest);
|
||||
*pRequest = NULL;
|
||||
return terrno;
|
||||
|
@ -245,7 +245,7 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param,
|
|||
int32_t err = taosHashPut(pTscObj->pRequests, &(*pRequest)->self, sizeof((*pRequest)->self), &(*pRequest)->self,
|
||||
sizeof((*pRequest)->self));
|
||||
if (err) {
|
||||
tscError("%" PRId64 " failed to add to request container,QID:0x%" PRIx64 ", conn:%" PRId64 ", %s",
|
||||
tscError("req:0x%" PRId64 ", failed to add to request container, QID:0x%" PRIx64 ", connObj:%" PRId64 ", %s",
|
||||
(*pRequest)->self, (*pRequest)->requestId, pTscObj->id, sql);
|
||||
destroyRequest(*pRequest);
|
||||
*pRequest = NULL;
|
||||
|
@ -256,7 +256,7 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param,
|
|||
if (tsQueryUseNodeAllocator && !qIsInsertValuesSql((*pRequest)->sqlstr, (*pRequest)->sqlLen)) {
|
||||
if (TSDB_CODE_SUCCESS !=
|
||||
nodesCreateAllocator((*pRequest)->requestId, tsQueryNodeChunkSize, &((*pRequest)->allocatorRefId))) {
|
||||
tscError("%" PRId64 " failed to create node allocator,QID:0x%" PRIx64 ", conn:%" PRId64 ", %s", (*pRequest)->self,
|
||||
tscError("req:0x%" PRId64 ", failed to create node allocator, QID:0x%" PRIx64 ", connObj:%" PRId64 ", %s", (*pRequest)->self,
|
||||
(*pRequest)->requestId, pTscObj->id, sql);
|
||||
destroyRequest(*pRequest);
|
||||
*pRequest = NULL;
|
||||
|
@ -264,7 +264,7 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param,
|
|||
}
|
||||
}
|
||||
|
||||
tscDebugL("0x%" PRIx64 " SQL: %s,QID:0x%" PRIx64, (*pRequest)->self, (*pRequest)->sqlstr, (*pRequest)->requestId);
|
||||
tscDebugL("req:0x%" PRIx64 ", QID:0x%" PRIx64 ", build request", (*pRequest)->self, (*pRequest)->requestId);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -381,10 +381,10 @@ void asyncExecLocalCmd(SRequestObj* pRequest, SQuery* pQuery) {
|
|||
|
||||
if (pRequest->code != TSDB_CODE_SUCCESS) {
|
||||
pResultInfo->numOfRows = 0;
|
||||
tscError("0x%" PRIx64 " fetch results failed, code:%s,QID:0x%" PRIx64, pRequest->self, tstrerror(code),
|
||||
tscError("req:0x%" PRIx64 ", fetch results failed, code:%s, QID:0x%" PRIx64, pRequest->self, tstrerror(code),
|
||||
pRequest->requestId);
|
||||
} else {
|
||||
tscDebug("0x%" PRIx64 " fetch results, numOfRows:%" PRId64 " total Rows:%" PRId64 ", complete:%d,QID:0x%" PRIx64,
|
||||
tscDebug("req:0x%" PRIx64 ", fetch results, numOfRows:%" PRId64 " total Rows:%" PRId64 ", complete:%d, QID:0x%" PRIx64,
|
||||
pRequest->self, pResultInfo->numOfRows, pResultInfo->totalRows, pResultInfo->completed,
|
||||
pRequest->requestId);
|
||||
}
|
||||
|
@ -1030,7 +1030,7 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) {
|
|||
break;
|
||||
}
|
||||
default:
|
||||
tscError("0x%" PRIx64 ", invalid exec result for request type %d,QID:0x%" PRIx64, pRequest->self, pRequest->type,
|
||||
tscError("req:0x%" PRIx64 ", invalid exec result for request type:%d, QID:0x%" PRIx64, pRequest->self, pRequest->type,
|
||||
pRequest->requestId);
|
||||
code = TSDB_CODE_APP_ERROR;
|
||||
}
|
||||
|
@ -1075,7 +1075,7 @@ void returnToUser(SRequestObj* pRequest) {
|
|||
(void)releaseRequest(pRequest->relation.userRefId);
|
||||
return;
|
||||
} else {
|
||||
tscError("0x%" PRIx64 ", user ref 0x%" PRIx64 " is not there,QID:0x%" PRIx64, pRequest->self,
|
||||
tscError("req:0x%" PRIx64 ", user ref 0x%" PRIx64 " is not there, QID:0x%" PRIx64, pRequest->self,
|
||||
pRequest->relation.userRefId, pRequest->requestId);
|
||||
}
|
||||
}
|
||||
|
@ -1146,7 +1146,7 @@ void postSubQueryFetchCb(void* param, TAOS_RES* res, int32_t rowNum) {
|
|||
SSDataBlock* pBlock = NULL;
|
||||
pRequest->code = createResultBlock(res, rowNum, &pBlock);
|
||||
if (TSDB_CODE_SUCCESS != pRequest->code) {
|
||||
tscError("0x%" PRIx64 ", create result block failed,QID:0x%" PRIx64 " %s", pRequest->self, pRequest->requestId,
|
||||
tscError("req:0x%" PRIx64 ", create result block failed, QID:0x%" PRIx64 " %s", pRequest->self, pRequest->requestId,
|
||||
tstrerror(pRequest->code));
|
||||
returnToUser(pRequest);
|
||||
return;
|
||||
|
@ -1157,7 +1157,7 @@ void postSubQueryFetchCb(void* param, TAOS_RES* res, int32_t rowNum) {
|
|||
continuePostSubQuery(pNextReq, pBlock);
|
||||
(void)releaseRequest(pRequest->relation.nextRefId);
|
||||
} else {
|
||||
tscError("0x%" PRIx64 ", next req ref 0x%" PRIx64 " is not there,QID:0x%" PRIx64, pRequest->self,
|
||||
tscError("req:0x%" PRIx64 ", next req ref 0x%" PRIx64 " is not there, QID:0x%" PRIx64, pRequest->self,
|
||||
pRequest->relation.nextRefId, pRequest->requestId);
|
||||
}
|
||||
|
||||
|
@ -1176,7 +1176,7 @@ void handlePostSubQuery(SSqlCallbackWrapper* pWrapper) {
|
|||
continuePostSubQuery(pNextReq, NULL);
|
||||
(void)releaseRequest(pRequest->relation.nextRefId);
|
||||
} else {
|
||||
tscError("0x%" PRIx64 ", next req ref 0x%" PRIx64 " is not there,QID:0x%" PRIx64, pRequest->self,
|
||||
tscError("req:0x%" PRIx64 ", next req ref 0x%" PRIx64 " is not there, QID:0x%" PRIx64, pRequest->self,
|
||||
pRequest->relation.nextRefId, pRequest->requestId);
|
||||
}
|
||||
}
|
||||
|
@ -1208,23 +1208,23 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) {
|
|||
}
|
||||
|
||||
taosMemoryFree(pResult);
|
||||
tscDebug("0x%" PRIx64 " enter scheduler exec cb, code:%s,QID:0x%" PRIx64, pRequest->self, tstrerror(code),
|
||||
tscDebug("req:0x%" PRIx64 ", enter scheduler exec cb, code:%s, QID:0x%" PRIx64, pRequest->self, tstrerror(code),
|
||||
pRequest->requestId);
|
||||
|
||||
if (code != TSDB_CODE_SUCCESS && NEED_CLIENT_HANDLE_ERROR(code) && pRequest->sqlstr != NULL) {
|
||||
tscDebug("0x%" PRIx64 " client retry to handle the error, code:%s, tryCount:%d,QID:0x%" PRIx64, pRequest->self,
|
||||
tscDebug("req:0x%" PRIx64 ", client retry to handle the error, code:%s, tryCount:%d, QID:0x%" PRIx64, pRequest->self,
|
||||
tstrerror(code), pRequest->retry, pRequest->requestId);
|
||||
if (TSDB_CODE_SUCCESS != removeMeta(pTscObj, pRequest->targetTableList, IS_VIEW_REQUEST(pRequest->type))) {
|
||||
tscError("0x%" PRIx64 " remove meta failed,QID:0x%" PRIx64, pRequest->self, pRequest->requestId);
|
||||
tscError("req:0x%" PRIx64 ", remove meta failed, QID:0x%" PRIx64, pRequest->self, pRequest->requestId);
|
||||
}
|
||||
restartAsyncQuery(pRequest, code);
|
||||
return;
|
||||
}
|
||||
|
||||
tscDebug("schedulerExecCb request type %s", TMSG_INFO(pRequest->type));
|
||||
tscTrace("req:0x%" PRIx64 ", scheduler exec cb, request type:%s", pRequest->self, TMSG_INFO(pRequest->type));
|
||||
if (NEED_CLIENT_RM_TBLMETA_REQ(pRequest->type) && NULL == pRequest->body.resInfo.execRes.res) {
|
||||
if (TSDB_CODE_SUCCESS != removeMeta(pTscObj, pRequest->targetTableList, IS_VIEW_REQUEST(pRequest->type))) {
|
||||
tscError("0x%" PRIx64 " remove meta failed,QID:0x%" PRIx64, pRequest->self, pRequest->requestId);
|
||||
tscError("req:0x%" PRIx64 ", remove meta failed, QID:0x%" PRIx64, pRequest->self, pRequest->requestId);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1322,7 +1322,7 @@ void launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQuery, void
|
|||
if (NEED_CLIENT_RM_TBLMETA_REQ(pRequest->type) && NULL == pRequest->body.resInfo.execRes.res) {
|
||||
int ret = removeMeta(pRequest->pTscObj, pRequest->targetTableList, IS_VIEW_REQUEST(pRequest->type));
|
||||
if (TSDB_CODE_SUCCESS != ret) {
|
||||
tscError("0x%" PRIx64 " remove meta failed,code:%d,QID:0x%" PRIx64, pRequest->self, ret, pRequest->requestId);
|
||||
tscError("req:0x%" PRIx64 ", remove meta failed,code:%d, QID:0x%" PRIx64, pRequest->self, ret, pRequest->requestId);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1370,7 +1370,7 @@ static int32_t asyncExecSchQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaDat
|
|||
code = qCreateQueryPlan(&cxt, &pDag, pMnodeList);
|
||||
}
|
||||
if (code) {
|
||||
tscError("0x%" PRIx64 " failed to create query plan, code:%s 0x%" PRIx64, pRequest->self, tstrerror(code),
|
||||
tscError("req:0x%" PRIx64 ", failed to create query plan, code:%s 0x%" PRIx64, pRequest->self, tstrerror(code),
|
||||
pRequest->requestId);
|
||||
} else {
|
||||
pRequest->body.subplanNum = pDag->numOfSubplans;
|
||||
|
@ -1414,7 +1414,7 @@ static int32_t asyncExecSchQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaDat
|
|||
taosArrayDestroy(pNodeList);
|
||||
} else {
|
||||
qDestroyQueryPlan(pDag);
|
||||
tscDebug("0x%" PRIx64 " plan not executed, code:%s 0x%" PRIx64, pRequest->self, tstrerror(code),
|
||||
tscDebug("req:0x%" PRIx64 ", plan not executed, code:%s 0x%" PRIx64, pRequest->self, tstrerror(code),
|
||||
pRequest->requestId);
|
||||
destorySqlCallbackWrapper(pWrapper);
|
||||
pRequest->pWrapper = NULL;
|
||||
|
@ -1472,7 +1472,7 @@ void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData* pResultM
|
|||
doRequestCallback(pRequest, 0);
|
||||
break;
|
||||
default:
|
||||
tscError("0x%" PRIx64 " invalid execMode %d", pRequest->self, pQuery->execMode);
|
||||
tscError("req:0x%" PRIx64 ", invalid execMode %d", pRequest->self, pQuery->execMode);
|
||||
doRequestCallback(pRequest, -1);
|
||||
break;
|
||||
}
|
||||
|
@ -1659,7 +1659,7 @@ int32_t taosConnectImpl(const char* user, const char* auth, const char* db, __ta
|
|||
*pTscObj = NULL;
|
||||
return terrno;
|
||||
} else {
|
||||
tscDebug("0x%" PRIx64 " connection is opening, connId:%u, dnodeConn:%p,QID:0x%" PRIx64, (*pTscObj)->id,
|
||||
tscInfo("connObj:0x%" PRIx64 ", connection is opening, connId:%u, dnodeConn:%p, QID:0x%" PRIx64, (*pTscObj)->id,
|
||||
(*pTscObj)->connId, (*pTscObj)->pAppInfo->pTransporter, pRequest->requestId);
|
||||
destroyRequest(pRequest);
|
||||
}
|
||||
|
@ -1754,14 +1754,14 @@ void updateTargetEpSet(SMsgSendInfo* pSendInfo, STscObj* pTscObj, SRpcMsg* pMsg,
|
|||
SCatalog* pCatalog = NULL;
|
||||
int32_t code = catalogGetHandle(pTscObj->pAppInfo->clusterId, &pCatalog);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
tscError("fail to get catalog handle, clusterId:%" PRIx64 ", error %s", pTscObj->pAppInfo->clusterId,
|
||||
tscError("fail to get catalog handle, clusterId:0x%" PRIx64 ", error:%s", pTscObj->pAppInfo->clusterId,
|
||||
tstrerror(code));
|
||||
return;
|
||||
}
|
||||
|
||||
code = catalogUpdateVgEpSet(pCatalog, pSendInfo->target.dbFName, pSendInfo->target.vgId, pEpSet);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
tscError("fail to update catalog vg epset, clusterId:%" PRIx64 ", error %s", pTscObj->pAppInfo->clusterId,
|
||||
tscError("fail to update catalog vg epset, clusterId:0x%" PRIx64 ", error:%s", pTscObj->pAppInfo->clusterId,
|
||||
tstrerror(code));
|
||||
return;
|
||||
}
|
||||
|
@ -1789,14 +1789,14 @@ int32_t doProcessMsgFromServerImpl(SRpcMsg* pMsg, SEpSet* pEpSet) {
|
|||
char tbuf[40] = {0};
|
||||
TRACE_TO_STR(trace, tbuf);
|
||||
|
||||
tscDebug("processMsgFromServer handle %p, message: %s, size:%d, code: %s,QID:%s", pMsg->info.handle,
|
||||
TMSG_INFO(pMsg->msgType), pMsg->contLen, tstrerror(pMsg->code), tbuf);
|
||||
tscDebug("QID:%s, process message from server, handle:%p, message:%s, size:%d, code:%s", tbuf, pMsg->info.handle,
|
||||
TMSG_INFO(pMsg->msgType), pMsg->contLen, tstrerror(pMsg->code));
|
||||
|
||||
if (pSendInfo->requestObjRefId != 0) {
|
||||
SRequestObj* pRequest = (SRequestObj*)taosAcquireRef(clientReqRefPool, pSendInfo->requestObjRefId);
|
||||
if (pRequest) {
|
||||
if (pRequest->self != pSendInfo->requestObjRefId) {
|
||||
tscError("doProcessMsgFromServer pRequest->self:%" PRId64 " != pSendInfo->requestObjRefId:%" PRId64,
|
||||
tscError("doProcessMsgFromServer req:0x%" PRId64 " != pSendInfo->requestObjRefId:0x%" PRId64,
|
||||
pRequest->self, pSendInfo->requestObjRefId);
|
||||
|
||||
if (TSDB_CODE_SUCCESS != taosReleaseRef(clientReqRefPool, pSendInfo->requestObjRefId)) {
|
||||
|
@ -1904,7 +1904,7 @@ _exit:
|
|||
}
|
||||
|
||||
TAOS* taos_connect_auth(const char* ip, const char* user, const char* auth, const char* db, uint16_t port) {
|
||||
tscDebug("try to connect to %s:%u by auth, user:%s db:%s", ip, port, user, db);
|
||||
tscInfo("try to connect to %s:%u by auth, user:%s db:%s", ip, port, user, db);
|
||||
if (user == NULL) {
|
||||
user = TSDB_DEFAULT_USER;
|
||||
}
|
||||
|
@ -2000,7 +2000,7 @@ void* doFetchRows(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUcs4)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
tscDebug("0x%" PRIx64 " fetch results, numOfRows:%" PRId64 " total Rows:%" PRId64 ", complete:%d,QID:0x%" PRIx64,
|
||||
tscDebug("req:0x%" PRIx64 ", fetch results, numOfRows:%" PRId64 " total Rows:%" PRId64 ", complete:%d, QID:0x%" PRIx64,
|
||||
pRequest->self, pResInfo->numOfRows, pResInfo->totalRows, pResInfo->completed, pRequest->requestId);
|
||||
|
||||
STscObj* pTscObj = pRequest->pTscObj;
|
||||
|
@ -2232,6 +2232,7 @@ static int32_t doConvertJson(SReqResultInfo* pResultInfo) {
|
|||
int32_t blockVersion = *(int32_t*)p;
|
||||
int32_t dataLen = estimateJsonLen(pResultInfo);
|
||||
if (dataLen <= 0) {
|
||||
tscError("doConvertJson error: estimateJsonLen failed");
|
||||
return TSDB_CODE_TSC_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
|
@ -2952,7 +2953,7 @@ TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly, int8_t s
|
|||
return NULL;
|
||||
}
|
||||
|
||||
tscDebug("taos_query start with sql:%s", sql);
|
||||
tscDebug("connObj:0x%" PRIx64 ", taos_query start with sql:%s", *(int64_t*)taos, sql);
|
||||
|
||||
SSyncQueryParam* param = taosMemoryCalloc(1, sizeof(SSyncQueryParam));
|
||||
if (NULL == param) {
|
||||
|
@ -2983,7 +2984,7 @@ TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly, int8_t s
|
|||
}
|
||||
taosMemoryFree(param);
|
||||
|
||||
tscDebug("taos_query end with sql:%s", sql);
|
||||
tscDebug("connObj:0x%" PRIx64 ", res:%p created, taos_query end", *(int64_t*)taos, pRequest);
|
||||
|
||||
return pRequest;
|
||||
}
|
||||
|
@ -3024,7 +3025,7 @@ static void fetchCallback(void* pResult, void* param, int32_t code) {
|
|||
|
||||
SReqResultInfo* pResultInfo = &pRequest->body.resInfo;
|
||||
|
||||
tscDebug("0x%" PRIx64 " enter scheduler fetch cb, code:%d - %s,QID:0x%" PRIx64, pRequest->self, code, tstrerror(code),
|
||||
tscDebug("req:0x%" PRIx64 ", enter scheduler fetch cb, code:%d - %s, QID:0x%" PRIx64, pRequest->self, code, tstrerror(code),
|
||||
pRequest->requestId);
|
||||
|
||||
pResultInfo->pData = pResult;
|
||||
|
@ -3047,10 +3048,10 @@ static void fetchCallback(void* pResult, void* param, int32_t code) {
|
|||
setQueryResultFromRsp(pResultInfo, (const SRetrieveTableRsp*)pResultInfo->pData, pResultInfo->convertUcs4);
|
||||
if (pRequest->code != TSDB_CODE_SUCCESS) {
|
||||
pResultInfo->numOfRows = 0;
|
||||
tscError("0x%" PRIx64 " fetch results failed, code:%s,QID:0x%" PRIx64, pRequest->self, tstrerror(pRequest->code),
|
||||
tscError("req:0x%" PRIx64 ", fetch results failed, code:%s, QID:0x%" PRIx64, pRequest->self, tstrerror(pRequest->code),
|
||||
pRequest->requestId);
|
||||
} else {
|
||||
tscDebug("0x%" PRIx64 " fetch results, numOfRows:%" PRId64 " total Rows:%" PRId64 ", complete:%d,QID:0x%" PRIx64,
|
||||
tscDebug("req:0x%" PRIx64 ", fetch results, numOfRows:%" PRId64 " total Rows:%" PRId64 ", complete:%d, QID:0x%" PRIx64,
|
||||
pRequest->self, pResultInfo->numOfRows, pResultInfo->totalRows, pResultInfo->completed,
|
||||
pRequest->requestId);
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ JNIEXPORT void JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_initImp(JNIEnv *e
|
|||
}
|
||||
|
||||
jniGetGlobalMethod(env);
|
||||
jniDebug("jni initialized successfully, config directory: %s", configDir);
|
||||
jniDebug("jni initialized successfully, config directory:%s", configDir);
|
||||
}
|
||||
|
||||
JNIEXPORT jobject createTSDBException(JNIEnv *env, int code, char *msg) {
|
||||
|
@ -453,7 +453,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getAffectedRowsIm
|
|||
}
|
||||
|
||||
jint ret = taos_affected_rows((TAOS_RES *)res);
|
||||
jniDebug("jobj:%p, conn:%p, sql:%p, res: %p, affect rows:%d", jobj, tscon, (TAOS *)con, (TAOS_RES *)res,
|
||||
jniDebug("jobj:%p, conn:%p, sql:%p, res:%p, affect rows:%d", jobj, tscon, (TAOS *)con, (TAOS_RES *)res,
|
||||
(int32_t)ret);
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -279,7 +279,7 @@ setConfRet taos_set_config(const char *config) {
|
|||
}
|
||||
|
||||
TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, uint16_t port) {
|
||||
tscDebug("try to connect to %s:%u, user:%s db:%s", ip, port, user, db);
|
||||
tscInfo("try to connect to %s:%u, user:%s db:%s", ip, port, user, db);
|
||||
if (user == NULL) {
|
||||
user = TSDB_DEFAULT_USER;
|
||||
}
|
||||
|
@ -478,10 +478,10 @@ void taos_close_internal(void *taos) {
|
|||
}
|
||||
|
||||
STscObj *pTscObj = (STscObj *)taos;
|
||||
tscDebug("0x%" PRIx64 " try to close connection, numOfReq:%d", pTscObj->id, pTscObj->numOfReqs);
|
||||
tscDebug("connObj:0x%" PRIx64 ", try to close connection, numOfReq:%d", pTscObj->id, pTscObj->numOfReqs);
|
||||
|
||||
if (TSDB_CODE_SUCCESS != taosRemoveRef(clientConnRefPool, pTscObj->id)) {
|
||||
tscError("0x%" PRIx64 " failed to remove ref from conn pool", pTscObj->id);
|
||||
tscError("connObj:0x%" PRIx64 ", failed to remove ref from conn pool", pTscObj->id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -535,14 +535,15 @@ void taos_free_result(TAOS_RES *res) {
|
|||
return;
|
||||
}
|
||||
|
||||
tscDebug("taos free res %p", res);
|
||||
tscTrace("res:%p, will be freed", res);
|
||||
|
||||
if (TD_RES_QUERY(res)) {
|
||||
SRequestObj *pRequest = (SRequestObj *)res;
|
||||
tscDebug("0x%" PRIx64 " taos_free_result start to free query", pRequest->requestId);
|
||||
tscDebug("QID:0x%" PRIx64 ", call taos_free_result to free query", pRequest->requestId);
|
||||
destroyRequest(pRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
SMqRspObj *pRsp = (SMqRspObj *)res;
|
||||
if (TD_RES_TMQ(res)) {
|
||||
tDeleteMqDataRsp(&pRsp->dataRsp);
|
||||
|
@ -890,6 +891,7 @@ int taos_select_db(TAOS *taos, const char *db) {
|
|||
|
||||
if (db == NULL || strlen(db) == 0) {
|
||||
releaseTscObj(*(int64_t *)taos);
|
||||
tscError("invalid parameter for %s", db == NULL ? "db is NULL" : "db is empty");
|
||||
terrno = TSDB_CODE_TSC_INVALID_INPUT;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -1157,7 +1159,7 @@ static void doAsyncQueryFromAnalyse(SMetaData *pResultMeta, void *param, int32_t
|
|||
SRequestObj *pRequest = pWrapper->pRequest;
|
||||
SQuery *pQuery = pRequest->pQuery;
|
||||
|
||||
qDebug("0x%" PRIx64 " start to semantic analysis,QID:0x%" PRIx64, pRequest->self, pRequest->requestId);
|
||||
qDebug("req:0x%" PRIx64 ", start to semantic analysis, QID:0x%" PRIx64, pRequest->self, pRequest->requestId);
|
||||
|
||||
int64_t analyseStart = taosGetTimestampUs();
|
||||
pRequest->metric.ctgCostUs = analyseStart - pRequest->metric.ctgStart;
|
||||
|
@ -1276,14 +1278,14 @@ void handleQueryAnslyseRes(SSqlCallbackWrapper *pWrapper, SMetaData *pResultMeta
|
|||
pRequest->pQuery = NULL;
|
||||
|
||||
if (NEED_CLIENT_HANDLE_ERROR(code)) {
|
||||
tscDebug("0x%" PRIx64 " client retry to handle the error, code:%d - %s, tryCount:%d,QID:0x%" PRIx64,
|
||||
tscDebug("req:0x%" PRIx64 ", client retry to handle the error, code:%d - %s, tryCount:%d, QID:0x%" PRIx64,
|
||||
pRequest->self, code, tstrerror(code), pRequest->retry, pRequest->requestId);
|
||||
restartAsyncQuery(pRequest, code);
|
||||
return;
|
||||
}
|
||||
|
||||
// return to app directly
|
||||
tscError("0x%" PRIx64 " error occurs, code:%s, return to user app,QID:0x%" PRIx64, pRequest->self, tstrerror(code),
|
||||
tscError("req:0x%" PRIx64 ", error occurs, code:%s, return to user app, QID:0x%" PRIx64, pRequest->self, tstrerror(code),
|
||||
pRequest->requestId);
|
||||
pRequest->code = code;
|
||||
returnToUser(pRequest);
|
||||
|
@ -1333,7 +1335,7 @@ static void doAsyncQueryFromParse(SMetaData *pResultMeta, void *param, int32_t c
|
|||
SQuery *pQuery = pRequest->pQuery;
|
||||
|
||||
pRequest->metric.ctgCostUs += taosGetTimestampUs() - pRequest->metric.ctgStart;
|
||||
qDebug("0x%" PRIx64 " start to continue parse,QID:0x%" PRIx64 ", code:%s", pRequest->self, pRequest->requestId,
|
||||
qDebug("req:0x%" PRIx64 ", start to continue parse, QID:0x%" PRIx64 ", code:%s", pRequest->self, pRequest->requestId,
|
||||
tstrerror(code));
|
||||
|
||||
if (code == TSDB_CODE_SUCCESS) {
|
||||
|
@ -1346,7 +1348,7 @@ static void doAsyncQueryFromParse(SMetaData *pResultMeta, void *param, int32_t c
|
|||
}
|
||||
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscError("0x%" PRIx64 " error happens, code:%d - %s,QID:0x%" PRIx64, pWrapper->pRequest->self, code,
|
||||
tscError("req:0x%" PRIx64 ", error happens, code:%d - %s, QID:0x%" PRIx64, pWrapper->pRequest->self, code,
|
||||
tstrerror(code), pWrapper->pRequest->requestId);
|
||||
destorySqlCallbackWrapper(pWrapper);
|
||||
pRequest->pWrapper = NULL;
|
||||
|
@ -1363,7 +1365,7 @@ void continueInsertFromCsv(SSqlCallbackWrapper *pWrapper, SRequestObj *pRequest)
|
|||
}
|
||||
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscError("0x%" PRIx64 " error happens, code:%d - %s,QID:0x%" PRIx64, pWrapper->pRequest->self, code,
|
||||
tscError("req:0x%" PRIx64 ", error happens, code:%d - %s, QID:0x%" PRIx64, pWrapper->pRequest->self, code,
|
||||
tstrerror(code), pWrapper->pRequest->requestId);
|
||||
destorySqlCallbackWrapper(pWrapper);
|
||||
pRequest->pWrapper = NULL;
|
||||
|
@ -1469,7 +1471,7 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) {
|
|||
code = pRequest->prevCode;
|
||||
terrno = code;
|
||||
pRequest->code = code;
|
||||
tscDebug("call sync query cb with code: %s", tstrerror(code));
|
||||
tscDebug("req:0x%" PRIx64 ", call sync query cb with code:%s", pRequest->self, tstrerror(code));
|
||||
doRequestCallback(pRequest, code);
|
||||
return;
|
||||
}
|
||||
|
@ -1484,7 +1486,7 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) {
|
|||
}
|
||||
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscError("0x%" PRIx64 " error happens, code:%d - %s,QID:0x%" PRIx64, pRequest->self, code, tstrerror(code),
|
||||
tscError("req:0x%" PRIx64 ", error happens, code:%d - %s, QID:0x%" PRIx64, pRequest->self, code, tstrerror(code),
|
||||
pRequest->requestId);
|
||||
destorySqlCallbackWrapper(pWrapper);
|
||||
pRequest->pWrapper = NULL;
|
||||
|
@ -1492,11 +1494,11 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) {
|
|||
pRequest->pQuery = NULL;
|
||||
|
||||
if (NEED_CLIENT_HANDLE_ERROR(code)) {
|
||||
tscDebug("0x%" PRIx64 " client retry to handle the error, code:%d - %s, tryCount:%d,QID:0x%" PRIx64,
|
||||
tscDebug("req:0x%" PRIx64 ", client retry to handle the error, code:%d - %s, tryCount:%d, QID:0x%" PRIx64,
|
||||
pRequest->self, code, tstrerror(code), pRequest->retry, pRequest->requestId);
|
||||
code = refreshMeta(pRequest->pTscObj, pRequest);
|
||||
if (code != 0) {
|
||||
tscWarn("0x%" PRIx64 " refresh meta failed, code:%d - %s,QID:0x%" PRIx64, pRequest->self, code, tstrerror(code),
|
||||
tscWarn("req:0x%" PRIx64 ", refresh meta failed, code:%d - %s, QID:0x%" PRIx64, pRequest->self, code, tstrerror(code),
|
||||
pRequest->requestId);
|
||||
}
|
||||
pRequest->prevCode = code;
|
||||
|
@ -1511,7 +1513,7 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) {
|
|||
}
|
||||
|
||||
void restartAsyncQuery(SRequestObj *pRequest, int32_t code) {
|
||||
tscInfo("restart request: %s p: %p", pRequest->sqlstr, pRequest);
|
||||
tscInfo("restart request:%s p:%p", pRequest->sqlstr, pRequest);
|
||||
SRequestObj *pUserReq = pRequest;
|
||||
(void)acquireRequest(pRequest->self);
|
||||
while (pUserReq) {
|
||||
|
@ -2182,7 +2184,7 @@ int taos_stmt2_bind_param(TAOS_STMT2 *stmt, TAOS_STMT2_BINDV *bindv, int32_t col
|
|||
|
||||
SSHashObj *hashTbnames = tSimpleHashInit(100, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR));
|
||||
if (NULL == hashTbnames) {
|
||||
tscError("stmt2 bind failed: %s", tstrerror(terrno));
|
||||
tscError("stmt2 bind failed, %s", tstrerror(terrno));
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
@ -2192,7 +2194,7 @@ int taos_stmt2_bind_param(TAOS_STMT2 *stmt, TAOS_STMT2_BINDV *bindv, int32_t col
|
|||
if (pStmt->sql.stbInterlaceMode) {
|
||||
if (tSimpleHashGet(hashTbnames, bindv->tbnames[i], strlen(bindv->tbnames[i])) != NULL) {
|
||||
code = terrno = TSDB_CODE_PAR_TBNAME_DUPLICATED;
|
||||
tscError("stmt2 bind failed: %s %s", tstrerror(terrno), bindv->tbnames[i]);
|
||||
tscError("stmt2 bind failed, %s %s", tstrerror(terrno), bindv->tbnames[i]);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -2258,10 +2260,6 @@ int taos_stmt2_bind_param_a(TAOS_STMT2 *stmt, TAOS_STMT2_BINDV *bindv, int32_t c
|
|||
}
|
||||
|
||||
STscStmt2 *pStmt = (STscStmt2 *)stmt;
|
||||
if (atomic_load_8((int8_t *)&pStmt->asyncBindParam.asyncBindNum) > 0) {
|
||||
tscError("async bind param is still working, please try again later");
|
||||
return TSDB_CODE_TSC_STMT_API_ERROR;
|
||||
}
|
||||
|
||||
ThreadArgs *args = (ThreadArgs *)taosMemoryMalloc(sizeof(ThreadArgs));
|
||||
args->stmt = stmt;
|
||||
|
@ -2269,14 +2267,23 @@ int taos_stmt2_bind_param_a(TAOS_STMT2 *stmt, TAOS_STMT2_BINDV *bindv, int32_t c
|
|||
args->col_idx = col_idx;
|
||||
args->fp = fp;
|
||||
args->param = param;
|
||||
|
||||
(void)taosThreadMutexLock(&(pStmt->asyncBindParam.mutex));
|
||||
if (atomic_load_8((int8_t *)&pStmt->asyncBindParam.asyncBindNum) > 0) {
|
||||
(void)taosThreadMutexUnlock(&(pStmt->asyncBindParam.mutex));
|
||||
tscError("async bind param is still working, please try again later");
|
||||
return TSDB_CODE_TSC_STMT_API_ERROR;
|
||||
}
|
||||
(void)atomic_add_fetch_8(&pStmt->asyncBindParam.asyncBindNum, 1);
|
||||
(void)taosThreadMutexUnlock(&(pStmt->asyncBindParam.mutex));
|
||||
|
||||
int code_s = taosStmt2AsyncBind(stmtAsyncBindThreadFunc, (void *)args);
|
||||
if (code_s != TSDB_CODE_SUCCESS) {
|
||||
(void)taosThreadMutexLock(&(pStmt->asyncBindParam.mutex));
|
||||
(void)taosThreadCondSignal(&(pStmt->asyncBindParam.waitCond));
|
||||
(void)atomic_sub_fetch_8(&pStmt->asyncBindParam.asyncBindNum, 1);
|
||||
(void)taosThreadMutexUnlock(&(pStmt->asyncBindParam.mutex));
|
||||
// terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
tscError("async bind failed, code:%d , %s", code_s, tstrerror(code_s));
|
||||
}
|
||||
|
||||
return code_s;
|
||||
|
|
|
@ -97,7 +97,7 @@ static void monitorFreeSlowLogDataEx(void* paras) {
|
|||
static SAppInstInfo* getAppInstByClusterId(int64_t clusterId) {
|
||||
void* p = taosHashGet(appInfo.pInstMapByClusterId, &clusterId, LONG_BYTES);
|
||||
if (p == NULL) {
|
||||
tscError("failed to get app inst, clusterId:%" PRIx64, clusterId);
|
||||
tscError("failed to get app inst, clusterId:0x%" PRIx64, clusterId);
|
||||
return NULL;
|
||||
}
|
||||
return *(SAppInstInfo**)p;
|
||||
|
@ -114,7 +114,7 @@ static int32_t monitorReportAsyncCB(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
if (param != NULL) {
|
||||
MonitorSlowLogData* p = (MonitorSlowLogData*)param;
|
||||
if (code != 0) {
|
||||
tscError("failed to send slow log:%s, clusterId:%" PRIx64, p->data, p->clusterId);
|
||||
tscError("failed to send slow log:%s, clusterId:0x%" PRIx64, p->data, p->clusterId);
|
||||
}
|
||||
MonitorSlowLogData tmp = {.clusterId = p->clusterId,
|
||||
.type = p->type,
|
||||
|
@ -241,7 +241,7 @@ void monitorCreateClient(int64_t clusterId) {
|
|||
MonitorClient* pMonitor = NULL;
|
||||
taosWLockLatch(&monitorLock);
|
||||
if (taosHashGet(monitorCounterHash, &clusterId, LONG_BYTES) == NULL) {
|
||||
tscInfo("[monitor] monitorCreateClient for %" PRIx64, clusterId);
|
||||
tscInfo("clusterId:0x%" PRIx64 ", create monitor", clusterId);
|
||||
pMonitor = taosMemoryCalloc(1, sizeof(MonitorClient));
|
||||
if (pMonitor == NULL) {
|
||||
tscError("failed to create monitor client");
|
||||
|
@ -293,7 +293,7 @@ void monitorCreateClient(int64_t clusterId) {
|
|||
tscError("failed to start timer");
|
||||
goto fail;
|
||||
}
|
||||
tscInfo("[monitor] monitorCreateClient for %" PRIx64 "finished %p.", clusterId, pMonitor);
|
||||
tscInfo("clusterId:0x%" PRIx64 ", create monitor finished, monitor:%p", clusterId, pMonitor);
|
||||
}
|
||||
taosWUnLockLatch(&monitorLock);
|
||||
|
||||
|
@ -319,7 +319,7 @@ void monitorCreateClientCounter(int64_t clusterId, const char* name, const char*
|
|||
tscError("failed to add metric to collector");
|
||||
int r = taos_counter_destroy(newCounter);
|
||||
if (r) {
|
||||
tscError("failed to destroy counter, code: %d", r);
|
||||
tscError("failed to destroy counter, code:%d", r);
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
|
@ -327,11 +327,11 @@ void monitorCreateClientCounter(int64_t clusterId, const char* name, const char*
|
|||
tscError("failed to put counter to monitor");
|
||||
int r = taos_counter_destroy(newCounter);
|
||||
if (r) {
|
||||
tscError("failed to destroy counter, code: %d", r);
|
||||
tscError("failed to destroy counter, code:%d", r);
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
tscInfo("[monitor] monitorCreateClientCounter %" PRIx64 "(%p):%s : %p.", pMonitor->clusterId, pMonitor, name,
|
||||
tscInfo("clusterId:0x%" PRIx64 ", monitor:%p, create counter:%s %p", pMonitor->clusterId, pMonitor, name,
|
||||
newCounter);
|
||||
|
||||
end:
|
||||
|
@ -347,21 +347,21 @@ void monitorCounterInc(int64_t clusterId, const char* counterName, const char**
|
|||
|
||||
MonitorClient** ppMonitor = (MonitorClient**)taosHashGet(monitorCounterHash, &clusterId, LONG_BYTES);
|
||||
if (ppMonitor == NULL || *ppMonitor == NULL) {
|
||||
tscError("monitorCounterInc not found pMonitor %" PRId64, clusterId);
|
||||
tscError("clusterId:0x%" PRIx64 ", monitor not found", clusterId);
|
||||
goto end;
|
||||
}
|
||||
|
||||
MonitorClient* pMonitor = *ppMonitor;
|
||||
taos_counter_t** ppCounter = (taos_counter_t**)taosHashGet(pMonitor->counters, counterName, strlen(counterName));
|
||||
if (ppCounter == NULL || *ppCounter == NULL) {
|
||||
tscError("monitorCounterInc not found pCounter %" PRIx64 ":%s.", clusterId, counterName);
|
||||
tscError("clusterId:0x%" PRIx64 ", monitor:%p counter:%s not found", clusterId, pMonitor, counterName);
|
||||
goto end;
|
||||
}
|
||||
if (taos_counter_inc(*ppCounter, label_values) != 0) {
|
||||
tscError("monitorCounterInc failed to inc %" PRIx64 ":%s.", clusterId, counterName);
|
||||
tscError("clusterId:0x%" PRIx64 ", monitor:%p counter:%s inc failed", clusterId, pMonitor, counterName);
|
||||
goto end;
|
||||
}
|
||||
tscDebug("[monitor] monitorCounterInc %" PRIx64 "(%p):%s", pMonitor->clusterId, pMonitor, counterName);
|
||||
tscDebug("clusterId:0x%" PRIx64 ", monitor:%p, counter:%s inc", pMonitor->clusterId, pMonitor, counterName);
|
||||
|
||||
end:
|
||||
taosWUnLockLatch(&monitorLock);
|
||||
|
@ -379,11 +379,11 @@ static void monitorWriteSlowLog2File(MonitorSlowLogData* slowLogData, char* tmpP
|
|||
char path[PATH_MAX] = {0};
|
||||
char clusterId[32] = {0};
|
||||
if (snprintf(clusterId, sizeof(clusterId), "%" PRIx64, slowLogData->clusterId) < 0) {
|
||||
tscError("failed to generate clusterId:%" PRIx64, slowLogData->clusterId);
|
||||
tscError("failed to generate clusterId:0x%" PRIx64, slowLogData->clusterId);
|
||||
return;
|
||||
}
|
||||
taosGetTmpfilePath(tmpPath, clusterId, path);
|
||||
tscInfo("[monitor] create slow log file:%s", path);
|
||||
tscInfo("monitor create slow log file:%s", path);
|
||||
pFile = taosOpenFile(path, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND | TD_FILE_READ | TD_FILE_TRUNC);
|
||||
if (pFile == NULL) {
|
||||
tscError("failed to open file:%s since %d", path, terrno);
|
||||
|
@ -404,7 +404,7 @@ static void monitorWriteSlowLog2File(MonitorSlowLogData* slowLogData, char* tmpP
|
|||
pClient->offset = 0;
|
||||
pClient->pFile = pFile;
|
||||
if (taosHashPut(monitorSlowLogHash, &slowLogData->clusterId, LONG_BYTES, &pClient, POINTER_BYTES) != 0) {
|
||||
tscError("failed to put clusterId:%" PRId64 " to hash table", slowLogData->clusterId);
|
||||
tscError("failed to put clusterId:0x%" PRIx64 " to hash table", slowLogData->clusterId);
|
||||
int32_t ret = taosCloseFile(&pFile);
|
||||
if (ret != 0) {
|
||||
tscError("failed to close file:%p ret:%d", pFile, ret);
|
||||
|
@ -422,19 +422,19 @@ static void monitorWriteSlowLog2File(MonitorSlowLogData* slowLogData, char* tmpP
|
|||
}
|
||||
|
||||
if (taosLSeekFile(pFile, 0, SEEK_END) < 0) {
|
||||
tscError("failed to seek file:%p code: %d", pFile, terrno);
|
||||
tscError("failed to seek file:%p code:%d", pFile, terrno);
|
||||
return;
|
||||
}
|
||||
if (taosWriteFile(pFile, slowLogData->data, strlen(slowLogData->data) + 1) < 0) {
|
||||
tscError("failed to write len to file:%p since %s", pFile, terrstr());
|
||||
}
|
||||
tscDebug("[monitor] write slow log to file:%p, clusterId:%" PRIx64, pFile, slowLogData->clusterId);
|
||||
tscDebug("monitor write slow log to file:%p, clusterId:0x%" PRIx64, pFile, slowLogData->clusterId);
|
||||
}
|
||||
|
||||
static char* readFile(TdFilePtr pFile, int64_t* offset, int64_t size) {
|
||||
tscDebug("[monitor] readFile slow begin pFile:%p, offset:%" PRId64 ", size:%" PRId64, pFile, *offset, size);
|
||||
tscDebug("monitor readFile slow begin pFile:%p, offset:%" PRId64 ", size:%" PRId64, pFile, *offset, size);
|
||||
if (taosLSeekFile(pFile, *offset, SEEK_SET) < 0) {
|
||||
tscError("failed to seek file:%p code: %d", pFile, terrno);
|
||||
tscError("failed to seek file:%p code:%d", pFile, terrno);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -481,7 +481,7 @@ static char* readFile(TdFilePtr pFile, int64_t* offset, int64_t size) {
|
|||
*offset += (len + 1);
|
||||
}
|
||||
|
||||
tscDebug("[monitor] readFile slow log end, data:%s, offset:%" PRId64, pCont, *offset);
|
||||
tscDebug("monitor readFile slow log end, data:%s, offset:%" PRId64, pCont, *offset);
|
||||
return pCont;
|
||||
}
|
||||
|
||||
|
@ -525,7 +525,7 @@ static int32_t monitorReadSend(int64_t clusterId, TdFilePtr pFile, int64_t* offs
|
|||
SLOW_LOG_QUEUE_TYPE type, char* fileName) {
|
||||
SAppInstInfo* pInst = getAppInstByClusterId(clusterId);
|
||||
if (pInst == NULL) {
|
||||
tscError("failed to get app instance by clusterId:%" PRId64, clusterId);
|
||||
tscError("failed to get app instance by clusterId:0x%" PRIx64, clusterId);
|
||||
if (taosCloseFile(&pFile) != 0) {
|
||||
tscError("failed to close file:%p", pFile);
|
||||
}
|
||||
|
@ -546,13 +546,13 @@ static void monitorSendSlowLogAtBeginning(int64_t clusterId, char** fileName, Td
|
|||
int64_t size = getFileSize(*fileName);
|
||||
if (size <= offset) {
|
||||
processFileInTheEnd(pFile, *fileName);
|
||||
tscDebug("[monitor] monitorSendSlowLogAtBeginning delete file:%s", *fileName);
|
||||
tscDebug("monitor delete file:%s", *fileName);
|
||||
} else {
|
||||
int32_t code = monitorReadSend(clusterId, pFile, &offset, size, SLOW_LOG_READ_BEGINNIG, *fileName);
|
||||
if (code == 0) {
|
||||
tscDebug("[monitor] monitorSendSlowLogAtBeginning send slow log succ, clusterId:%" PRId64, clusterId);
|
||||
tscDebug("monitor send slow log succ, clusterId:0x%" PRIx64, clusterId);
|
||||
} else {
|
||||
tscError("[monitor] monitorSendSlowLogAtBeginning send slow log failed, clusterId:%" PRId64 ",ret:%d", clusterId,
|
||||
tscError("monitor send slow log failed, clusterId:0x%" PRIx64 ", ret:%d", clusterId,
|
||||
code);
|
||||
}
|
||||
*fileName = NULL;
|
||||
|
@ -562,24 +562,24 @@ static void monitorSendSlowLogAtBeginning(int64_t clusterId, char** fileName, Td
|
|||
static void monitorSendSlowLogAtRunning(int64_t clusterId) {
|
||||
void* tmp = taosHashGet(monitorSlowLogHash, &clusterId, LONG_BYTES);
|
||||
if (tmp == NULL) {
|
||||
tscError("failed to get slow log client by clusterId:%" PRId64, clusterId);
|
||||
tscError("failed to get slow log client by clusterId:0x%" PRIx64, clusterId);
|
||||
return;
|
||||
}
|
||||
SlowLogClient* pClient = (*(SlowLogClient**)tmp);
|
||||
if (pClient == NULL) {
|
||||
tscError("failed to get slow log client by clusterId:%" PRId64, clusterId);
|
||||
tscError("failed to get slow log client by clusterId:0x%" PRIx64, clusterId);
|
||||
return;
|
||||
}
|
||||
int64_t size = getFileSize(pClient->path);
|
||||
if (size <= pClient->offset) {
|
||||
if (taosFtruncateFile(pClient->pFile, 0) < 0) {
|
||||
tscError("failed to truncate file:%p code: %d", pClient->pFile, terrno);
|
||||
tscError("failed to truncate file:%p code:%d", pClient->pFile, terrno);
|
||||
}
|
||||
tscDebug("[monitor] monitorSendSlowLogAtRunning truncate file to 0 file:%p", pClient->pFile);
|
||||
tscDebug("monitor truncate file to 0 file:%p", pClient->pFile);
|
||||
pClient->offset = 0;
|
||||
} else {
|
||||
int32_t code = monitorReadSend(clusterId, pClient->pFile, &pClient->offset, size, SLOW_LOG_READ_RUNNING, NULL);
|
||||
tscDebug("[monitor] monitorSendSlowLogAtRunning send slow log clusterId:%" PRId64 ",ret:%d", clusterId, code);
|
||||
tscDebug("monitor send slow log clusterId:0x%" PRIx64 ", ret:%d", clusterId, code);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -596,13 +596,13 @@ static bool monitorSendSlowLogAtQuit(int64_t clusterId) {
|
|||
if (size <= pClient->offset) {
|
||||
processFileInTheEnd(pClient->pFile, pClient->path);
|
||||
pClient->pFile = NULL;
|
||||
tscInfo("[monitor] monitorSendSlowLogAtQuit remove file:%s", pClient->path);
|
||||
tscInfo("monitor remove file:%s", pClient->path);
|
||||
if ((--quitCnt) == 0) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
int32_t code = monitorReadSend(clusterId, pClient->pFile, &pClient->offset, size, SLOW_LOG_READ_QUIT, NULL);
|
||||
tscDebug("[monitor] monitorSendSlowLogAtQuit send slow log clusterId:%" PRId64 ",ret:%d", clusterId, code);
|
||||
tscDebug("monitor send slow log clusterId:0x%" PRIx64 ", ret:%d", clusterId, code);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -620,7 +620,7 @@ static void monitorSendAllSlowLogAtQuit() {
|
|||
} else if (pClient->offset == 0) {
|
||||
int64_t* clusterId = (int64_t*)taosHashGetKey(pIter, NULL);
|
||||
int32_t code = monitorReadSend(*clusterId, pClient->pFile, &pClient->offset, size, SLOW_LOG_READ_QUIT, NULL);
|
||||
tscDebug("[monitor] monitorSendAllSlowLogAtQuit send slow log clusterId:%" PRId64 ",ret:%d", *clusterId, code);
|
||||
tscDebug("monitor send slow log clusterId:0x%" PRIx64 ", ret:%d", *clusterId, code);
|
||||
if (code == 0) {
|
||||
quitCnt++;
|
||||
}
|
||||
|
@ -669,7 +669,7 @@ static void monitorSendAllSlowLog() {
|
|||
int64_t size = getFileSize(pClient->path);
|
||||
if (size <= 0) {
|
||||
if (size < 0) {
|
||||
tscError("[monitor] monitorSendAllSlowLog failed to get file size:%s, err:%d", pClient->path, errno);
|
||||
tscError("monitor failed to get file size:%s, err:%d", pClient->path, errno);
|
||||
if (errno == ENOENT) {
|
||||
processFileRemoved(pClient);
|
||||
}
|
||||
|
@ -677,7 +677,7 @@ static void monitorSendAllSlowLog() {
|
|||
continue;
|
||||
}
|
||||
int32_t code = monitorReadSend(*clusterId, pClient->pFile, &pClient->offset, size, SLOW_LOG_READ_RUNNING, NULL);
|
||||
tscDebug("[monitor] monitorSendAllSlowLog send slow log clusterId:%" PRId64 ",ret:%d", *clusterId, code);
|
||||
tscDebug("monitor send slow log clusterId:0x%" PRIx64 ", ret:%d", *clusterId, code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -686,7 +686,7 @@ static void monitorSendAllSlowLogFromTempDir(int64_t clusterId) {
|
|||
SAppInstInfo* pInst = getAppInstByClusterId((int64_t)clusterId);
|
||||
|
||||
if (pInst == NULL || !pInst->serverCfg.monitorParas.tsEnableMonitor) {
|
||||
tscInfo("[monitor] monitor is disabled, skip send slow log");
|
||||
tscInfo("monitor is disabled, skip send slow log");
|
||||
return;
|
||||
}
|
||||
char namePrefix[PATH_MAX] = {0};
|
||||
|
@ -755,7 +755,7 @@ static void monitorSendAllSlowLogFromTempDir(int64_t clusterId) {
|
|||
|
||||
static void* monitorThreadFunc(void* param) {
|
||||
setThreadName("client-monitor-slowlog");
|
||||
tscDebug("monitorThreadFunc start");
|
||||
tscInfo("monitor update thread started");
|
||||
int64_t quitTime = 0;
|
||||
while (1) {
|
||||
if (atomic_load_32(&monitorFlag) == 1) {
|
||||
|
@ -837,7 +837,7 @@ static void tscMonitorStop() {
|
|||
int32_t monitorInit() {
|
||||
int32_t code = 0;
|
||||
|
||||
tscInfo("[monitor] tscMonitor init");
|
||||
tscInfo("monitor init");
|
||||
monitorCounterHash =
|
||||
(SHashObj*)taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_ENTRY_LOCK);
|
||||
if (monitorCounterHash == NULL) {
|
||||
|
@ -887,7 +887,7 @@ int32_t monitorInit() {
|
|||
}
|
||||
|
||||
void monitorClose() {
|
||||
tscInfo("[monitor] tscMonitor close");
|
||||
tscInfo("monitor close");
|
||||
taosWLockLatch(&monitorLock);
|
||||
atomic_store_32(&monitorFlag, 1);
|
||||
tscMonitorStop();
|
||||
|
@ -907,17 +907,17 @@ int32_t monitorPutData2MonitorQueue(MonitorSlowLogData data) {
|
|||
MonitorSlowLogData* slowLogData = NULL;
|
||||
|
||||
if (atomic_load_32(&monitorFlag) == 1) {
|
||||
tscError("[monitor] slow log thread is exiting");
|
||||
tscError("monitor slow log thread is exiting");
|
||||
return -1;
|
||||
}
|
||||
|
||||
code = taosAllocateQitem(sizeof(MonitorSlowLogData), DEF_QITEM, 0, (void**)&slowLogData);
|
||||
if (code) {
|
||||
tscError("[monitor] failed to allocate slow log data");
|
||||
tscError("monitor failed to allocate slow log data");
|
||||
return code;
|
||||
}
|
||||
*slowLogData = data;
|
||||
tscDebug("[monitor] write slow log to queue, clusterId:%" PRIx64 " type:%s, data:%s", slowLogData->clusterId,
|
||||
tscDebug("monitor write slow log to queue, clusterId:0x%" PRIx64 " type:%s, data:%s", slowLogData->clusterId,
|
||||
queueTypeStr[slowLogData->type], slowLogData->data);
|
||||
if (taosWriteQitem(monitorQueue, slowLogData) == 0) {
|
||||
if (tsem2_post(&monitorSem) != 0) {
|
||||
|
@ -943,7 +943,7 @@ int32_t reportCB(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
int32_t senAuditInfo(STscObj* pTscObj, void* pReq, int32_t len, uint64_t requestId) {
|
||||
SMsgSendInfo* sendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
|
||||
if (sendInfo == NULL) {
|
||||
tscError("[del report]failed to allocate memory for sendInfo");
|
||||
tscError("[del report] failed to allocate memory for sendInfo");
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
@ -959,7 +959,7 @@ int32_t senAuditInfo(STscObj* pTscObj, void* pReq, int32_t len, uint64_t request
|
|||
|
||||
int32_t code = asyncSendMsgToServer(pTscObj->pAppInfo->pTransporter, &epSet, NULL, sendInfo);
|
||||
if (code != 0) {
|
||||
tscError("[del report]failed to send msg to server, code:%d", code);
|
||||
tscError("[del report] failed to send msg to server, code:%d", code);
|
||||
taosMemoryFree(sendInfo);
|
||||
return code;
|
||||
}
|
||||
|
@ -971,22 +971,22 @@ static void reportDeleteSql(SRequestObj* pRequest) {
|
|||
STscObj* pTscObj = pRequest->pTscObj;
|
||||
|
||||
if (pTscObj == NULL || pTscObj->pAppInfo == NULL) {
|
||||
tscError("[del report]invalid tsc obj");
|
||||
tscError("[del report] invalid tsc obj");
|
||||
return;
|
||||
}
|
||||
|
||||
if(pTscObj->pAppInfo->serverCfg.enableAuditDelete == 0) {
|
||||
tscDebug("[del report]audit delete is disabled");
|
||||
tscDebug("[del report] audit delete is disabled");
|
||||
return;
|
||||
}
|
||||
|
||||
if (pRequest->code != TSDB_CODE_SUCCESS) {
|
||||
tscDebug("[del report]delete request result code:%d", pRequest->code);
|
||||
tscDebug("[del report] delete request result code:%d", pRequest->code);
|
||||
return;
|
||||
}
|
||||
|
||||
if (nodeType(pStmt->pFromTable) != QUERY_NODE_REAL_TABLE) {
|
||||
tscError("[del report]invalid from table node type:%d", nodeType(pStmt->pFromTable));
|
||||
tscError("[del report] invalid from table node type:%d", nodeType(pStmt->pFromTable));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1000,28 +1000,28 @@ static void reportDeleteSql(SRequestObj* pRequest) {
|
|||
int32_t tlen = tSerializeSAuditReq(NULL, 0, &req);
|
||||
void* pReq = taosMemoryCalloc(1, tlen);
|
||||
if (pReq == NULL) {
|
||||
tscError("[del report]failed to allocate memory for req");
|
||||
tscError("[del report] failed to allocate memory for req");
|
||||
return;
|
||||
}
|
||||
|
||||
if (tSerializeSAuditReq(pReq, tlen, &req) < 0) {
|
||||
tscError("[del report]failed to serialize req");
|
||||
tscError("[del report] failed to serialize req");
|
||||
taosMemoryFree(pReq);
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t code = senAuditInfo(pRequest->pTscObj, pReq, tlen, pRequest->requestId);
|
||||
if (code != 0) {
|
||||
tscError("[del report]failed to send audit info, code:%d", code);
|
||||
tscError("[del report] failed to send audit info, code:%d", code);
|
||||
taosMemoryFree(pReq);
|
||||
return;
|
||||
}
|
||||
tscDebug("[del report]delete data, sql:%s", req.pSql);
|
||||
tscDebug("[del report] delete data, sql:%s", req.pSql);
|
||||
}
|
||||
|
||||
void clientOperateReport(SRequestObj* pRequest) {
|
||||
if (pRequest == NULL || pRequest->pQuery == NULL || pRequest->pQuery->pRoot == NULL) {
|
||||
tscError("[del report]invalid request");
|
||||
tscError("[del report] invalid request");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
}
|
||||
|
||||
if ((code = taosCheckVersionCompatibleFromStr(td_version, connectRsp.sVer, 3)) != 0) {
|
||||
tscError("version not compatible. client version: %s, server version: %s", td_version, connectRsp.sVer);
|
||||
tscError("version not compatible. client version:%s, server version:%s", td_version, connectRsp.sVer);
|
||||
goto End;
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
}
|
||||
|
||||
for (int32_t i = 0; i < connectRsp.epSet.numOfEps; ++i) {
|
||||
tscDebug("0x%" PRIx64 " epSet.fqdn[%d]:%s port:%d, connObj:0x%" PRIx64, pRequest->requestId, i,
|
||||
tscDebug("QID:0x%" PRIx64 ", epSet.fqdn[%d]:%s port:%d, connObj:0x%" PRIx64, pRequest->requestId, i,
|
||||
connectRsp.epSet.eps[i].fqdn, connectRsp.epSet.eps[i].port, pTscObj->id);
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
pTscObj->pAppInfo->clusterId = connectRsp.clusterId;
|
||||
pTscObj->pAppInfo->serverCfg.monitorParas = connectRsp.monitorParas;
|
||||
pTscObj->pAppInfo->serverCfg.enableAuditDelete = connectRsp.enableAuditDelete;
|
||||
tscDebug("[monitor] paras from connect rsp, clusterId:%" PRIx64 " monitorParas threshold:%d scope:%d",
|
||||
tscDebug("monitor paras from connect rsp, clusterId:0x%" PRIx64 ", threshold:%d scope:%d",
|
||||
connectRsp.clusterId, connectRsp.monitorParas.tsSlowLogThreshold, connectRsp.monitorParas.tsSlowLogScope);
|
||||
lastClusterId = connectRsp.clusterId;
|
||||
|
||||
|
@ -164,7 +164,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
SAppHbMgr* pAppHbMgr = taosArrayGetP(clientHbMgr.appHbMgrs, pTscObj->appHbMgrIdx);
|
||||
if (pAppHbMgr) {
|
||||
if (hbRegisterConn(pAppHbMgr, pTscObj->id, connectRsp.clusterId, connectRsp.connType) != 0) {
|
||||
tscError("0x%" PRIx64 " failed to register conn to hbMgr", pRequest->requestId);
|
||||
tscError("QID:0x%" PRIx64 ", failed to register conn to hbMgr", pRequest->requestId);
|
||||
}
|
||||
} else {
|
||||
(void)taosThreadMutexUnlock(&clientHbMgr.lock);
|
||||
|
@ -173,7 +173,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
}
|
||||
(void)taosThreadMutexUnlock(&clientHbMgr.lock);
|
||||
|
||||
tscDebug("0x%" PRIx64 " clusterId:%" PRId64 ", totalConn:%" PRId64, pRequest->requestId, connectRsp.clusterId,
|
||||
tscDebug("QID:0x%" PRIx64 ", clusterId:0x%" PRIx64 ", totalConn:%" PRId64, pRequest->requestId, connectRsp.clusterId,
|
||||
pTscObj->pAppInfo->numOfConns);
|
||||
|
||||
End:
|
||||
|
@ -229,11 +229,11 @@ int32_t processCreateDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
char dbFName[TSDB_DB_FNAME_LEN];
|
||||
(void)snprintf(dbFName, sizeof(dbFName) - 1, "%d.%s", pTscObj->acctId, TSDB_INFORMATION_SCHEMA_DB);
|
||||
if (catalogRefreshDBVgInfo(pCatalog, &conn, dbFName) != 0) {
|
||||
tscError("0x%" PRIx64 " failed to refresh db vg info", pRequest->requestId);
|
||||
tscError("QID:0x%" PRIx64 ", failed to refresh db vg info", pRequest->requestId);
|
||||
}
|
||||
(void)snprintf(dbFName, sizeof(dbFName) - 1, "%d.%s", pTscObj->acctId, TSDB_PERFORMANCE_SCHEMA_DB);
|
||||
if (catalogRefreshDBVgInfo(pCatalog, &conn, dbFName) != 0) {
|
||||
tscError("0x%" PRIx64 " failed to refresh db vg info", pRequest->requestId);
|
||||
tscError("QID:0x%" PRIx64 ", failed to refresh db vg info", pRequest->requestId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
TSDB_CODE_MND_DB_IN_DROPPING == code) {
|
||||
SUseDbRsp usedbRsp = {0};
|
||||
if (tDeserializeSUseDbRsp(pMsg->pData, pMsg->len, &usedbRsp) != 0) {
|
||||
tscError("0x%" PRIx64 " deserialize SUseDbRsp failed", pRequest->requestId);
|
||||
tscError("QID:0x%" PRIx64 ", deserialize SUseDbRsp failed", pRequest->requestId);
|
||||
}
|
||||
struct SCatalog* pCatalog = NULL;
|
||||
|
||||
|
@ -262,11 +262,11 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
int64_t clusterId = pRequest->pTscObj->pAppInfo->clusterId;
|
||||
int32_t code1 = catalogGetHandle(clusterId, &pCatalog);
|
||||
if (code1 != TSDB_CODE_SUCCESS) {
|
||||
tscWarn("0x%" PRIx64 "catalogGetHandle failed, clusterId:%" PRIx64 ", error:%s", pRequest->requestId, clusterId,
|
||||
tscWarn("QID:0x%" PRIx64 ", catalogGetHandle failed, clusterId:0x%" PRIx64 ", error:%s", pRequest->requestId, clusterId,
|
||||
tstrerror(code1));
|
||||
} else {
|
||||
if (catalogRemoveDB(pCatalog, usedbRsp.db, usedbRsp.uid) != 0) {
|
||||
tscError("0x%" PRIx64 "catalogRemoveDB failed, db:%s, uid:%" PRId64, pRequest->requestId, usedbRsp.db,
|
||||
tscError("QID:0x%" PRIx64 ", catalogRemoveDB failed, db:%s, uid:%" PRId64, pRequest->requestId, usedbRsp.db,
|
||||
usedbRsp.uid);
|
||||
}
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
|
||||
SUseDbRsp usedbRsp = {0};
|
||||
if (tDeserializeSUseDbRsp(pMsg->pData, pMsg->len, &usedbRsp) != 0) {
|
||||
tscError("0x%" PRIx64 " deserialize SUseDbRsp failed", pRequest->requestId);
|
||||
tscError("QID:0x%" PRIx64 ", deserialize SUseDbRsp failed", pRequest->requestId);
|
||||
}
|
||||
|
||||
if (strlen(usedbRsp.db) == 0) {
|
||||
|
@ -321,7 +321,7 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
|
||||
SName name = {0};
|
||||
if (tNameFromString(&name, usedbRsp.db, T_NAME_ACCT | T_NAME_DB) != TSDB_CODE_SUCCESS) {
|
||||
tscError("0x%" PRIx64 " failed to parse db name:%s", pRequest->requestId, usedbRsp.db);
|
||||
tscError("QID:0x%" PRIx64 ", failed to parse db name:%s", pRequest->requestId, usedbRsp.db);
|
||||
}
|
||||
|
||||
SUseDbOutput output = {0};
|
||||
|
@ -330,17 +330,17 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
terrno = code;
|
||||
if (output.dbVgroup) taosHashCleanup(output.dbVgroup->vgHash);
|
||||
|
||||
tscError("0x%" PRIx64 " failed to build use db output since %s", pRequest->requestId, terrstr());
|
||||
tscError("QID:0x%" PRIx64 ", failed to build use db output since %s", pRequest->requestId, terrstr());
|
||||
} else if (output.dbVgroup && output.dbVgroup->vgHash) {
|
||||
struct SCatalog* pCatalog = NULL;
|
||||
|
||||
int32_t code1 = catalogGetHandle(pRequest->pTscObj->pAppInfo->clusterId, &pCatalog);
|
||||
if (code1 != TSDB_CODE_SUCCESS) {
|
||||
tscWarn("catalogGetHandle failed, clusterId:%" PRIx64 ", error:%s", pRequest->pTscObj->pAppInfo->clusterId,
|
||||
tscWarn("catalogGetHandle failed, clusterId:0x%" PRIx64 ", error:%s", pRequest->pTscObj->pAppInfo->clusterId,
|
||||
tstrerror(code1));
|
||||
} else {
|
||||
if (catalogUpdateDBVgInfo(pCatalog, output.db, output.dbId, output.dbVgroup) != 0) {
|
||||
tscError("0x%" PRIx64 " failed to update db vg info, db:%s, dbId:%" PRId64, pRequest->requestId, output.db,
|
||||
tscError("QID:0x%" PRIx64 ", failed to update db vg info, db:%s, dbId:%" PRId64, pRequest->requestId, output.db,
|
||||
output.dbId);
|
||||
}
|
||||
output.dbVgroup = NULL;
|
||||
|
@ -352,7 +352,7 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
|
||||
char db[TSDB_DB_NAME_LEN] = {0};
|
||||
if (tNameGetDbName(&name, db) != TSDB_CODE_SUCCESS) {
|
||||
tscError("0x%" PRIx64 " failed to get db name since %s", pRequest->requestId, tstrerror(code));
|
||||
tscError("QID:0x%" PRIx64 ", failed to get db name since %s", pRequest->requestId, tstrerror(code));
|
||||
}
|
||||
|
||||
setConnectionDB(pRequest->pTscObj, db);
|
||||
|
@ -372,11 +372,13 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
|
||||
int32_t processCreateSTableRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
||||
if (pMsg == NULL) {
|
||||
tscError("processCreateSTableRsp: invalid input param, pMsg is NULL");
|
||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||
}
|
||||
if (param == NULL) {
|
||||
taosMemoryFree(pMsg->pEpSet);
|
||||
taosMemoryFree(pMsg->pData);
|
||||
tscError("processCreateSTableRsp: invalid input param, param is NULL");
|
||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||
}
|
||||
|
||||
|
@ -434,13 +436,13 @@ int32_t processDropDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
} else {
|
||||
SDropDbRsp dropdbRsp = {0};
|
||||
if (tDeserializeSDropDbRsp(pMsg->pData, pMsg->len, &dropdbRsp) != 0) {
|
||||
tscError("0x%" PRIx64 " deserialize SDropDbRsp failed", pRequest->requestId);
|
||||
tscError("QID:0x%" PRIx64 ", deserialize SDropDbRsp failed", pRequest->requestId);
|
||||
}
|
||||
struct SCatalog* pCatalog = NULL;
|
||||
code = catalogGetHandle(pRequest->pTscObj->pAppInfo->clusterId, &pCatalog);
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
if (catalogRemoveDB(pCatalog, dropdbRsp.db, dropdbRsp.uid) != 0) {
|
||||
tscError("0x%" PRIx64 " failed to remove db:%s", pRequest->requestId, dropdbRsp.db);
|
||||
tscError("QID:0x%" PRIx64 ", failed to remove db:%s", pRequest->requestId, dropdbRsp.db);
|
||||
}
|
||||
STscObj* pTscObj = pRequest->pTscObj;
|
||||
|
||||
|
@ -451,11 +453,11 @@ int32_t processDropDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
char dbFName[TSDB_DB_FNAME_LEN] = {0};
|
||||
(void)snprintf(dbFName, sizeof(dbFName) - 1, "%d.%s", pTscObj->acctId, TSDB_INFORMATION_SCHEMA_DB);
|
||||
if (catalogRefreshDBVgInfo(pCatalog, &conn, dbFName) != TSDB_CODE_SUCCESS) {
|
||||
tscError("0x%" PRIx64 " failed to refresh db vg info, db:%s", pRequest->requestId, dbFName);
|
||||
tscError("QID:0x%" PRIx64 ", failed to refresh db vg info, db:%s", pRequest->requestId, dbFName);
|
||||
}
|
||||
(void)snprintf(dbFName, sizeof(dbFName) - 1, "%d.%s", pTscObj->acctId, TSDB_PERFORMANCE_SCHEMA_DB);
|
||||
if (catalogRefreshDBVgInfo(pCatalog, &conn, dbFName) != 0) {
|
||||
tscError("0x%" PRIx64 " failed to refresh db vg info, db:%s", pRequest->requestId, dbFName);
|
||||
tscError("QID:0x%" PRIx64 ", failed to refresh db vg info, db:%s", pRequest->requestId, dbFName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
#define LOG_ID_TAG "connId:0x%" PRIx64 ",QID:0x%" PRIx64
|
||||
#define LOG_ID_TAG "connId:0x%" PRIx64 ", QID:0x%" PRIx64
|
||||
#define LOG_ID_VALUE *(int64_t*)taos, pRequest->requestId
|
||||
|
||||
#define TMQ_META_VERSION "1.0"
|
||||
|
|
|
@ -410,7 +410,7 @@ END:
|
|||
int32_t smlParseEndTelnetJsonFormat(SSmlHandle *info, SSmlLineInfo *elements, SSmlKv *kvTs, SSmlKv *kv) {
|
||||
int32_t code = 0;
|
||||
int32_t lino = 0;
|
||||
uDebug("SML:0x%" PRIx64 " %s format true, ts:%" PRId64, info->id, __FUNCTION__ , kvTs->i);
|
||||
uDebug("SML:0x%" PRIx64 ", %s format true, ts:%" PRId64, info->id, __FUNCTION__ , kvTs->i);
|
||||
SML_CHECK_CODE(smlBuildCol(info->currTableDataCtx, info->currSTableMeta->schema, kvTs, 0, info->taos->optionInfo.charsetCxt));
|
||||
SML_CHECK_CODE(smlBuildCol(info->currTableDataCtx, info->currSTableMeta->schema, kv, 1, info->taos->optionInfo.charsetCxt));
|
||||
SML_CHECK_CODE(smlBuildRow(info->currTableDataCtx));
|
||||
|
@ -423,7 +423,7 @@ END:
|
|||
int32_t smlParseEndTelnetJsonUnFormat(SSmlHandle *info, SSmlLineInfo *elements, SSmlKv *kvTs, SSmlKv *kv) {
|
||||
int32_t code = 0;
|
||||
int32_t lino = 0;
|
||||
uDebug("SML:0x%" PRIx64 " %s format false, ts:%" PRId64, info->id, __FUNCTION__, kvTs->i);
|
||||
uDebug("SML:0x%" PRIx64 ", %s format false, ts:%" PRId64, info->id, __FUNCTION__, kvTs->i);
|
||||
if (elements->colArray == NULL) {
|
||||
elements->colArray = taosArrayInit(16, sizeof(SSmlKv));
|
||||
SML_CHECK_NULL(elements->colArray);
|
||||
|
@ -437,7 +437,7 @@ END:
|
|||
|
||||
int32_t smlParseEndLine(SSmlHandle *info, SSmlLineInfo *elements, SSmlKv *kvTs) {
|
||||
if (info->dataFormat) {
|
||||
uDebug("SML:0x%" PRIx64 " %s format true, ts:%" PRId64, info->id, __FUNCTION__, kvTs->i);
|
||||
uDebug("SML:0x%" PRIx64 ", %s format true, ts:%" PRId64, info->id, __FUNCTION__, kvTs->i);
|
||||
int32_t ret = smlBuildCol(info->currTableDataCtx, info->currSTableMeta->schema, kvTs, 0, info->taos->optionInfo.charsetCxt);
|
||||
if (ret == TSDB_CODE_SUCCESS) {
|
||||
ret = smlBuildRow(info->currTableDataCtx);
|
||||
|
@ -446,11 +446,11 @@ int32_t smlParseEndLine(SSmlHandle *info, SSmlLineInfo *elements, SSmlKv *kvTs)
|
|||
clearColValArraySml(info->currTableDataCtx->pValues);
|
||||
taosArrayClearP(info->escapedStringList, NULL);
|
||||
if (unlikely(ret != TSDB_CODE_SUCCESS)) {
|
||||
uError("SML:0x%" PRIx64 " %s smlBuildCol error:%d", info->id, __FUNCTION__, ret);
|
||||
uError("SML:0x%" PRIx64 ", %s smlBuildCol error:%d", info->id, __FUNCTION__, ret);
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
uDebug("SML:0x%" PRIx64 " %s format false, ts:%" PRId64, info->id, __FUNCTION__, kvTs->i);
|
||||
uDebug("SML:0x%" PRIx64 ", %s format false, ts:%" PRId64, info->id, __FUNCTION__, kvTs->i);
|
||||
taosArraySet(elements->colArray, 0, kvTs);
|
||||
}
|
||||
info->preLine = *elements;
|
||||
|
@ -697,7 +697,7 @@ static int32_t smlGenerateSchemaAction(SSchema *colField, SHashObj *colHash, SSm
|
|||
uint16_t *index = colHash ? (uint16_t *)taosHashGet(colHash, kv->key, kv->keyLen) : NULL;
|
||||
if (index) {
|
||||
if (colField[*index].type != kv->type) {
|
||||
snprintf(info->msgBuf.buf, info->msgBuf.len, "SML:0x%" PRIx64 " %s point type and db type mismatch. db type: %s, point type: %s, key: %s",
|
||||
snprintf(info->msgBuf.buf, info->msgBuf.len, "SML:0x%" PRIx64 ", %s point type and db type mismatch, db type:%s, point type:%s, key:%s",
|
||||
info->id, __FUNCTION__, tDataTypes[colField[*index].type].name, tDataTypes[kv->type].name, kv->key);
|
||||
uError("%s", info->msgBuf.buf);
|
||||
return TSDB_CODE_SML_INVALID_DATA;
|
||||
|
@ -954,7 +954,7 @@ static int32_t smlCreateTable(SSmlHandle *info, SRequestConnInfo *conn, SSmlSTab
|
|||
SArray *pColumns = NULL;
|
||||
SArray *pTags = NULL;
|
||||
SML_CHECK_CODE(smlCheckAuth(info, conn, NULL, AUTH_TYPE_WRITE));
|
||||
uDebug("SML:0x%" PRIx64 " %s create table:%s", info->id, __FUNCTION__, pName->tname);
|
||||
uDebug("SML:0x%" PRIx64 ", %s create table:%s", info->id, __FUNCTION__, pName->tname);
|
||||
pColumns = taosArrayInit(taosArrayGetSize(sTableData->cols), sizeof(SField));
|
||||
SML_CHECK_NULL(pColumns);
|
||||
pTags = taosArrayInit(taosArrayGetSize(sTableData->tags), sizeof(SField));
|
||||
|
@ -1005,7 +1005,7 @@ static int32_t smlModifyTag(SSmlHandle *info, SHashObj* hashTmpCheck, SHashObj*
|
|||
|
||||
if (action != SCHEMA_ACTION_NULL) {
|
||||
SML_CHECK_CODE(smlCheckAuth(info, conn, pName->tname, AUTH_TYPE_WRITE));
|
||||
uDebug("SML:0x%" PRIx64 " %s change table tag, table:%s, action:%d", info->id, __FUNCTION__, pName->tname,
|
||||
uDebug("SML:0x%" PRIx64 ", %s change table tag, table:%s, action:%d", info->id, __FUNCTION__, pName->tname,
|
||||
action);
|
||||
SML_CHECK_CODE(smlBuildFields(&pColumns, &pTags, *pTableMeta, sTableData));
|
||||
SML_CHECK_CODE(smlBuildFieldsList(info, (*pTableMeta)->schema, hashTmp, sTableData->tags, pTags,
|
||||
|
@ -1036,7 +1036,7 @@ static int32_t smlModifyCols(SSmlHandle *info, SHashObj* hashTmpCheck, SHashObj*
|
|||
|
||||
if (action != SCHEMA_ACTION_NULL) {
|
||||
SML_CHECK_CODE(smlCheckAuth(info, conn, pName->tname, AUTH_TYPE_WRITE));
|
||||
uDebug("SML:0x%" PRIx64 " %s change table col, table:%s, action:%d", info->id, __FUNCTION__, pName->tname,
|
||||
uDebug("SML:0x%" PRIx64 ", %s change table col, table:%s, action:%d", info->id, __FUNCTION__, pName->tname,
|
||||
action);
|
||||
SML_CHECK_CODE(smlBuildFields(&pColumns, &pTags, *pTableMeta, sTableData));
|
||||
SML_CHECK_CODE(smlBuildFieldsList(info, (*pTableMeta)->schema, hashTmp, sTableData->cols, pColumns,
|
||||
|
@ -1068,7 +1068,7 @@ END:
|
|||
}
|
||||
|
||||
static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
||||
uDebug("SML:0x%" PRIx64 " %s start, format:%d, needModifySchema:%d", info->id, __FUNCTION__, info->dataFormat,
|
||||
uDebug("SML:0x%" PRIx64 ", %s start, format:%d, needModifySchema:%d", info->id, __FUNCTION__, info->dataFormat,
|
||||
info->needModifySchema);
|
||||
if (info->dataFormat && !info->needModifySchema) {
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -1132,7 +1132,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
|||
colHashTmp = NULL;
|
||||
tagHashTmp = NULL;
|
||||
} else {
|
||||
uError("SML:0x%" PRIx64 " %s load table meta error: %s", info->id, __FUNCTION__, tstrerror(code));
|
||||
uError("SML:0x%" PRIx64 ", %s load table meta error:%s", info->id, __FUNCTION__, tstrerror(code));
|
||||
goto END;
|
||||
}
|
||||
|
||||
|
@ -1143,11 +1143,11 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
|||
|
||||
taosMemoryFreeClear(sTableData->tableMeta);
|
||||
sTableData->tableMeta = pTableMeta;
|
||||
uDebug("SML:0x%" PRIx64 " %s modify schema uid:%" PRIu64 ", sversion:%d, tversion:%d", info->id, __FUNCTION__, pTableMeta->uid,
|
||||
uDebug("SML:0x%" PRIx64 ", %s modify schema uid:%" PRIu64 ", sversion:%d, tversion:%d", info->id, __FUNCTION__, pTableMeta->uid,
|
||||
pTableMeta->sversion, pTableMeta->tversion);
|
||||
tmp = (SSmlSTableMeta **)taosHashIterate(info->superTables, tmp);
|
||||
}
|
||||
uDebug("SML:0x%" PRIx64 " %s end success, format:%d, needModifySchema:%d", info->id, __FUNCTION__, info->dataFormat,
|
||||
uDebug("SML:0x%" PRIx64 ", %s end success, format:%d, needModifySchema:%d", info->id, __FUNCTION__, info->dataFormat,
|
||||
info->needModifySchema);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -1158,7 +1158,7 @@ END:
|
|||
taosHashCleanup(tagHashTmp);
|
||||
taosMemoryFreeClear(pTableMeta);
|
||||
(void)catalogRefreshTableMeta(info->pCatalog, &conn, &pName, 1); // ignore refresh meta code if there is an error
|
||||
uError("SML:0x%" PRIx64 " %s end failed:%d:%s, format:%d, needModifySchema:%d", info->id, __FUNCTION__, code,
|
||||
uError("SML:0x%" PRIx64 ", %s end failed:%d:%s, format:%d, needModifySchema:%d", info->id, __FUNCTION__, code,
|
||||
tstrerror(code), info->dataFormat, info->needModifySchema);
|
||||
|
||||
return code;
|
||||
|
@ -1356,7 +1356,7 @@ END:
|
|||
}
|
||||
|
||||
static int32_t smlParseEnd(SSmlHandle *info) {
|
||||
uDebug("SML:0x%" PRIx64 " %s start, format:%d, linenum:%d", info->id, __FUNCTION__, info->dataFormat,
|
||||
uDebug("SML:0x%" PRIx64 ", %s start, format:%d, linenum:%d", info->id, __FUNCTION__, info->dataFormat,
|
||||
info->lineNum);
|
||||
int32_t code = 0;
|
||||
int32_t lino = 0;
|
||||
|
@ -1376,7 +1376,7 @@ static int32_t smlParseEnd(SSmlHandle *info) {
|
|||
}
|
||||
|
||||
if (tinfo == NULL) {
|
||||
uError("SML:0x%" PRIx64 "get oneTable failed, line num:%d", info->id, i);
|
||||
uError("SML:0x%" PRIx64 ", get oneTable failed, line num:%d", info->id, i);
|
||||
smlBuildInvalidDataMsg(&info->msgBuf, "get oneTable failed", elements->measure);
|
||||
return TSDB_CODE_SML_INVALID_DATA;
|
||||
}
|
||||
|
@ -1396,14 +1396,14 @@ static int32_t smlParseEnd(SSmlHandle *info) {
|
|||
SSmlSTableMeta **tableMeta =
|
||||
(SSmlSTableMeta **)taosHashGet(info->superTables, elements->measure, elements->measureLen);
|
||||
if (tableMeta) { // update meta
|
||||
uDebug("SML:0x%" PRIx64 " %s update meta, format:%d, linenum:%d", info->id, __FUNCTION__, info->dataFormat,
|
||||
uDebug("SML:0x%" PRIx64 ", %s update meta, format:%d, linenum:%d", info->id, __FUNCTION__, info->dataFormat,
|
||||
info->lineNum);
|
||||
SML_CHECK_CODE(smlUpdateMeta((*tableMeta)->colHash, (*tableMeta)->cols, elements->colArray, false, &info->msgBuf,
|
||||
(*tableMeta)->tagHash));
|
||||
SML_CHECK_CODE(smlUpdateMeta((*tableMeta)->tagHash, (*tableMeta)->tags, tinfo->tags, true, &info->msgBuf,
|
||||
(*tableMeta)->colHash));
|
||||
} else {
|
||||
uDebug("SML:0x%" PRIx64 " %s add meta, format:%d, linenum:%d", info->id, __FUNCTION__, info->dataFormat,
|
||||
uDebug("SML:0x%" PRIx64 ", %s add meta, format:%d, linenum:%d", info->id, __FUNCTION__, info->dataFormat,
|
||||
info->lineNum);
|
||||
SSmlSTableMeta *meta = NULL;
|
||||
SML_CHECK_CODE(smlBuildSTableMeta(info->dataFormat, &meta));
|
||||
|
@ -1416,7 +1416,7 @@ static int32_t smlParseEnd(SSmlHandle *info) {
|
|||
SML_CHECK_CODE(smlInsertMeta(meta->colHash, meta->cols, elements->colArray, meta->tagHash));
|
||||
}
|
||||
}
|
||||
uDebug("SML:0x%" PRIx64 " %s end, format:%d, linenum:%d", info->id, __FUNCTION__, info->dataFormat, info->lineNum);
|
||||
uDebug("SML:0x%" PRIx64 ", %s end, format:%d, linenum:%d", info->id, __FUNCTION__, info->dataFormat, info->lineNum);
|
||||
|
||||
END:
|
||||
RETURN
|
||||
|
@ -1427,7 +1427,7 @@ static int32_t smlInsertData(SSmlHandle *info) {
|
|||
int32_t lino = 0;
|
||||
char *measure = NULL;
|
||||
SSmlTableInfo **oneTable = NULL;
|
||||
uDebug("SML:0x%" PRIx64 " %s start, format:%d", info->id, __FUNCTION__, info->dataFormat);
|
||||
uDebug("SML:0x%" PRIx64 ", %s start, format:%d", info->id, __FUNCTION__, info->dataFormat);
|
||||
|
||||
if (info->pRequest->dbList == NULL) {
|
||||
info->pRequest->dbList = taosArrayInit(1, TSDB_DB_FNAME_LEN);
|
||||
|
@ -1476,14 +1476,14 @@ static int32_t smlInsertData(SSmlHandle *info) {
|
|||
SSmlSTableMeta **pMeta =
|
||||
(SSmlSTableMeta **)taosHashGet(info->superTables, tableData->sTableName, tableData->sTableNameLen);
|
||||
if (unlikely(NULL == pMeta || NULL == *pMeta || NULL == (*pMeta)->tableMeta)) {
|
||||
uError("SML:0x%" PRIx64 " %s NULL == pMeta. table name: %s", info->id, __FUNCTION__, tableData->childTableName);
|
||||
uError("SML:0x%" PRIx64 ", %s NULL == pMeta. table name:%s", info->id, __FUNCTION__, tableData->childTableName);
|
||||
SML_CHECK_CODE(TSDB_CODE_SML_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
// use tablemeta of stable to save vgid and uid of child table
|
||||
(*pMeta)->tableMeta->vgId = vg.vgId;
|
||||
(*pMeta)->tableMeta->uid = tableData->uid; // one table merge data block together according uid
|
||||
uDebug("SML:0x%" PRIx64 " %s table:%s, uid:%" PRIu64 ", format:%d", info->id, __FUNCTION__, pName.tname,
|
||||
uDebug("SML:0x%" PRIx64 ", %s table:%s, uid:%" PRIu64 ", format:%d", info->id, __FUNCTION__, pName.tname,
|
||||
tableData->uid, info->dataFormat);
|
||||
|
||||
SML_CHECK_CODE(smlBindData(info->pQuery, info->dataFormat, tableData->tags, (*pMeta)->cols, tableData->cols,
|
||||
|
@ -1501,7 +1501,7 @@ static int32_t smlInsertData(SSmlHandle *info) {
|
|||
|
||||
launchQueryImpl(info->pRequest, info->pQuery, true, NULL); // no need to check return code
|
||||
|
||||
uDebug("SML:0x%" PRIx64 " %s end, format:%d, code:%d,%s", info->id, __FUNCTION__, info->dataFormat, info->pRequest->code,
|
||||
uDebug("SML:0x%" PRIx64 ", %s end, format:%d, code:%d,%s", info->id, __FUNCTION__, info->dataFormat, info->pRequest->code,
|
||||
tstrerror(info->pRequest->code));
|
||||
|
||||
return info->pRequest->code;
|
||||
|
@ -1558,15 +1558,15 @@ END:
|
|||
static void printRaw(int64_t id, int lineNum, int numLines, ELogLevel level, char* data, int32_t len){
|
||||
char *print = taosMemoryMalloc(len + 1);
|
||||
if (print == NULL) {
|
||||
uError("SML:0x%" PRIx64 " smlParseLine failed. code : %d", id, terrno);
|
||||
uError("SML:0x%" PRIx64 ", smlParseLine failed. code :%d", id, terrno);
|
||||
return;
|
||||
}
|
||||
(void)memcpy(print, data, len);
|
||||
print[len] = '\0';
|
||||
if (level == DEBUG_DEBUG){
|
||||
uDebug("SML:0x%" PRIx64 " smlParseLine is raw, line %d/%d : %s", id, lineNum, numLines, print);
|
||||
uDebug("SML:0x%" PRIx64 ", smlParseLine is raw, line %d/%d :%s", id, lineNum, numLines, print);
|
||||
}else if (level == DEBUG_ERROR){
|
||||
uError("SML:0x%" PRIx64 " smlParseLine failed. line %d/%d : %s", id, lineNum, numLines, print);
|
||||
uError("SML:0x%" PRIx64 ", smlParseLine failed. line %d/%d :%s", id, lineNum, numLines, print);
|
||||
}
|
||||
taosMemoryFree(print);
|
||||
}
|
||||
|
@ -1592,7 +1592,7 @@ static bool getLine(SSmlHandle *info, char *lines[], char **rawLine, char *rawLi
|
|||
if (*rawLine != NULL && (uDebugFlag & DEBUG_DEBUG)) {
|
||||
printRaw(info->id, i, numLines, DEBUG_DEBUG, *tmp, *len);
|
||||
} else {
|
||||
uDebug("SML:0x%" PRIx64 " smlParseLine is not raw, line %d/%d : %s", info->id, i, numLines, *tmp);
|
||||
uDebug("SML:0x%" PRIx64 ", smlParseLine is not raw, line %d/%d :%s", info->id, i, numLines, *tmp);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1612,7 +1612,7 @@ static int32_t smlParseJson(SSmlHandle *info, char *lines[], char *rawLine) {
|
|||
}
|
||||
|
||||
static int32_t smlParseStart(SSmlHandle *info, char *lines[], char *rawLine, char *rawLineEnd, int numLines) {
|
||||
uDebug("SML:0x%" PRIx64 " %s start", info->id, __FUNCTION__);
|
||||
uDebug("SML:0x%" PRIx64 ", %s start", info->id, __FUNCTION__);
|
||||
int32_t code = TSDB_CODE_SUCCESS;
|
||||
if (info->protocol == TSDB_SML_JSON_PROTOCOL) {
|
||||
return smlParseJson(info, lines, rawLine);
|
||||
|
@ -1646,12 +1646,12 @@ static int32_t smlParseStart(SSmlHandle *info, char *lines[], char *rawLine, cha
|
|||
if (rawLine != NULL) {
|
||||
printRaw(info->id, i, numLines, DEBUG_ERROR, tmp, len);
|
||||
} else {
|
||||
uError("SML:0x%" PRIx64 " %s failed. line %d : %s", info->id, __FUNCTION__, i, tmp);
|
||||
uError("SML:0x%" PRIx64 ", %s failed. line %d :%s", info->id, __FUNCTION__, i, tmp);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
if (info->reRun) {
|
||||
uDebug("SML:0x%" PRIx64 " %s re run", info->id, __FUNCTION__);
|
||||
uDebug("SML:0x%" PRIx64 ", %s re run", info->id, __FUNCTION__);
|
||||
i = 0;
|
||||
rawLine = oldRaw;
|
||||
code = smlClearForRerun(info);
|
||||
|
@ -1662,7 +1662,7 @@ static int32_t smlParseStart(SSmlHandle *info, char *lines[], char *rawLine, cha
|
|||
}
|
||||
i++;
|
||||
}
|
||||
uDebug("SML:0x%" PRIx64 " %s end", info->id, __FUNCTION__);
|
||||
uDebug("SML:0x%" PRIx64 ", %s end", info->id, __FUNCTION__);
|
||||
|
||||
return code;
|
||||
}
|
||||
|
@ -1689,7 +1689,7 @@ static int smlProcess(SSmlHandle *info, char *lines[], char *rawLine, char *rawL
|
|||
break;
|
||||
}
|
||||
taosMsleep(100);
|
||||
uInfo("SML:0x%" PRIx64 " smlModifyDBSchemas retry code:%s, times:%d", info->id, tstrerror(code), retryNum);
|
||||
uInfo("SML:0x%" PRIx64 ", smlModifyDBSchemas retry code:%s, times:%d", info->id, tstrerror(code), retryNum);
|
||||
} while (retryNum++ < taosHashGetSize(info->superTables) * MAX_RETRY_TIMES);
|
||||
|
||||
SML_CHECK_CODE(code);
|
||||
|
|
|
@ -103,7 +103,7 @@ int32_t stmtSwitchStatus(STscStmt* pStmt, STMT_STATUS newStatus) {
|
|||
}
|
||||
|
||||
if (pStmt->errCode && newStatus != STMT_PREPARE) {
|
||||
STMT_DLOG("stmt already failed with err: %s", tstrerror(pStmt->errCode));
|
||||
STMT_DLOG("stmt already failed with err:%s", tstrerror(pStmt->errCode));
|
||||
return pStmt->errCode;
|
||||
}
|
||||
|
||||
|
@ -574,7 +574,7 @@ int32_t stmtRebuildDataBlock(STscStmt* pStmt, STableDataCxt* pDataBlock, STableD
|
|||
STMT_ERR_RET(stmtTryAddTableVgroupInfo(pStmt, &vgId));
|
||||
STMT_ERR_RET(qRebuildStmtDataBlock(newBlock, pDataBlock, uid, suid, vgId, pStmt->sql.autoCreateTbl));
|
||||
|
||||
STMT_DLOG("tableDataCxt rebuilt, uid:%" PRId64 ", vgId:%d", uid, vgId);
|
||||
STMT_DLOG("uid:%" PRId64 ", rebuild table data context, vgId:%d", uid, vgId);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -984,7 +984,7 @@ int32_t stmtInitStbInterlaceTableInfo(STscStmt* pStmt) {
|
|||
int stmtSetDbName(TAOS_STMT* stmt, const char* dbName) {
|
||||
STscStmt* pStmt = (STscStmt*)stmt;
|
||||
|
||||
STMT_DLOG("start to set dbName: %s", dbName);
|
||||
STMT_DLOG("start to set dbName:%s", dbName);
|
||||
|
||||
STMT_ERR_RET(stmtCreateRequest(pStmt));
|
||||
|
||||
|
@ -1002,7 +1002,7 @@ int stmtSetTbName(TAOS_STMT* stmt, const char* tbName) {
|
|||
|
||||
int64_t startUs = taosGetTimestampUs();
|
||||
|
||||
STMT_DLOG("start to set tbName: %s", tbName);
|
||||
STMT_DLOG("start to set tbName:%s", tbName);
|
||||
|
||||
if (pStmt->errCode != TSDB_CODE_SUCCESS) {
|
||||
return pStmt->errCode;
|
||||
|
@ -1223,7 +1223,7 @@ int stmtBindBatch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, int32_t colIdx) {
|
|||
|
||||
int64_t startUs = taosGetTimestampUs();
|
||||
|
||||
STMT_DLOG("start to bind stmt data, colIdx: %d", colIdx);
|
||||
STMT_DLOG("start to bind stmt data, colIdx:%d", colIdx);
|
||||
|
||||
if (pStmt->errCode != TSDB_CODE_SUCCESS) {
|
||||
return pStmt->errCode;
|
||||
|
@ -1418,7 +1418,7 @@ int stmtAddBatch(TAOS_STMT* stmt) {
|
|||
}
|
||||
/*
|
||||
int stmtUpdateTableUid(STscStmt* pStmt, SSubmitRsp* pRsp) {
|
||||
tscDebug("stmt start to update tbUid, blockNum: %d", pRsp->nBlocks);
|
||||
tscDebug("stmt start to update tbUid, blockNum:%d", pRsp->nBlocks);
|
||||
|
||||
int32_t code = 0;
|
||||
int32_t finalCode = 0;
|
||||
|
@ -1645,7 +1645,7 @@ int stmtClose(TAOS_STMT* stmt) {
|
|||
(void)taosThreadCondDestroy(&pStmt->queue.waitCond);
|
||||
(void)taosThreadMutexDestroy(&pStmt->queue.mutex);
|
||||
|
||||
STMT_DLOG("stmt %p closed, stbInterlaceMode: %d, statInfo: ctgGetTbMetaNum=>%" PRId64 ", getCacheTbInfo=>%" PRId64
|
||||
STMT_DLOG("stmt %p closed, stbInterlaceMode:%d, statInfo: ctgGetTbMetaNum=>%" PRId64 ", getCacheTbInfo=>%" PRId64
|
||||
", parseSqlNum=>%" PRId64 ", pStmt->stat.bindDataNum=>%" PRId64
|
||||
", settbnameAPI:%u, bindAPI:%u, addbatchAPI:%u, execAPI:%u"
|
||||
", setTbNameUs:%" PRId64 ", bindDataUs:%" PRId64 ",%" PRId64 ",%" PRId64 ",%" PRId64 " addBatchUs:%" PRId64
|
||||
|
|
|
@ -107,7 +107,7 @@ static int32_t stmtSwitchStatus(STscStmt2* pStmt, STMT_STATUS newStatus) {
|
|||
}
|
||||
|
||||
if (pStmt->errCode && newStatus != STMT_PREPARE) {
|
||||
STMT_DLOG("stmt already failed with err: %s", tstrerror(pStmt->errCode));
|
||||
STMT_DLOG("stmt already failed with err:%s", tstrerror(pStmt->errCode));
|
||||
return pStmt->errCode;
|
||||
}
|
||||
|
||||
|
@ -504,7 +504,7 @@ static int32_t stmtRebuildDataBlock(STscStmt2* pStmt, STableDataCxt* pDataBlock,
|
|||
STMT_ERR_RET(stmtTryAddTableVgroupInfo(pStmt, &vgId));
|
||||
STMT_ERR_RET(qRebuildStmtDataBlock(newBlock, pDataBlock, uid, suid, vgId, pStmt->sql.autoCreateTbl));
|
||||
|
||||
STMT_DLOG("tableDataCxt rebuilt, uid:%" PRId64 ", vgId:%d", uid, vgId);
|
||||
STMT_DLOG("uid:%" PRId64 ", rebuild table data context, vgId:%d", uid, vgId);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -876,7 +876,7 @@ TAOS_STMT2* stmtInit2(STscObj* taos, TAOS_STMT2_OPTION* pOptions) {
|
|||
static int stmtSetDbName2(TAOS_STMT2* stmt, const char* dbName) {
|
||||
STscStmt2* pStmt = (STscStmt2*)stmt;
|
||||
|
||||
STMT_DLOG("start to set dbName: %s", dbName);
|
||||
STMT_DLOG("start to set dbName:%s", dbName);
|
||||
|
||||
pStmt->db = taosStrdup(dbName);
|
||||
(void)strdequote(pStmt->db);
|
||||
|
@ -972,7 +972,7 @@ int stmtSetTbName2(TAOS_STMT2* stmt, const char* tbName) {
|
|||
|
||||
int64_t startUs = taosGetTimestampUs();
|
||||
|
||||
STMT_DLOG("start to set tbName: %s", tbName);
|
||||
STMT_DLOG("start to set tbName:%s", tbName);
|
||||
|
||||
if (pStmt->errCode != TSDB_CODE_SUCCESS) {
|
||||
return pStmt->errCode;
|
||||
|
@ -1340,7 +1340,7 @@ int stmtBindBatch2(TAOS_STMT2* stmt, TAOS_STMT2_BIND* bind, int32_t colIdx) {
|
|||
|
||||
int64_t startUs = taosGetTimestampUs();
|
||||
|
||||
STMT_DLOG("start to bind stmt data, colIdx: %d", colIdx);
|
||||
STMT_DLOG("start to bind stmt data, colIdx:%d", colIdx);
|
||||
|
||||
if (pStmt->errCode != TSDB_CODE_SUCCESS) {
|
||||
return pStmt->errCode;
|
||||
|
@ -1520,7 +1520,7 @@ int stmtBindBatch2(TAOS_STMT2* stmt, TAOS_STMT2_BIND* bind, int32_t colIdx) {
|
|||
}
|
||||
/*
|
||||
int stmtUpdateTableUid(STscStmt2* pStmt, SSubmitRsp* pRsp) {
|
||||
tscDebug("stmt start to update tbUid, blockNum: %d", pRsp->nBlocks);
|
||||
tscDebug("stmt start to update tbUid, blockNum:%d", pRsp->nBlocks);
|
||||
|
||||
int32_t code = 0;
|
||||
int32_t finalCode = 0;
|
||||
|
@ -1841,7 +1841,7 @@ int stmtClose2(TAOS_STMT2* stmt) {
|
|||
}
|
||||
}
|
||||
|
||||
STMT_DLOG("stmt %p closed, stbInterlaceMode: %d, statInfo: ctgGetTbMetaNum=>%" PRId64 ", getCacheTbInfo=>%" PRId64
|
||||
STMT_DLOG("stmt %p closed, stbInterlaceMode:%d, statInfo: ctgGetTbMetaNum=>%" PRId64 ", getCacheTbInfo=>%" PRId64
|
||||
", parseSqlNum=>%" PRId64 ", pStmt->stat.bindDataNum=>%" PRId64
|
||||
", settbnameAPI:%u, bindAPI:%u, addbatchAPI:%u, execAPI:%u"
|
||||
", setTbNameUs:%" PRId64 ", bindDataUs:%" PRId64 ",%" PRId64 ",%" PRId64 ",%" PRId64 " addBatchUs:%" PRId64
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
#include "tref.h"
|
||||
#include "ttimer.h"
|
||||
|
||||
#define tqErrorC(...) do { if (cDebugFlag & DEBUG_ERROR || tqClientDebugFlag & DEBUG_ERROR) { taosPrintLog("TQ ERROR ", DEBUG_ERROR, tqClientDebugFlag|cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tqInfoC(...) do { if (cDebugFlag & DEBUG_INFO || tqClientDebugFlag & DEBUG_INFO) { taosPrintLog("TQ ", DEBUG_INFO, tqClientDebugFlag|cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tqDebugC(...) do { if (cDebugFlag & DEBUG_DEBUG || tqClientDebugFlag & DEBUG_DEBUG) { taosPrintLog("TQ ", DEBUG_DEBUG, tqClientDebugFlag|cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tqErrorC(...) do { if (cDebugFlag & DEBUG_ERROR || tqClientDebugFlag & DEBUG_ERROR) { taosPrintLog("TQ ERROR ", DEBUG_ERROR, tqClientDebugFlag|cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tqInfoC(...) do { if (cDebugFlag & DEBUG_INFO || tqClientDebugFlag & DEBUG_INFO) { taosPrintLog("TQ INFO ", DEBUG_INFO, tqClientDebugFlag|cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tqDebugC(...) do { if (cDebugFlag & DEBUG_DEBUG || tqClientDebugFlag & DEBUG_DEBUG) { taosPrintLog("TQ DEBUG ", DEBUG_DEBUG, tqClientDebugFlag|cDebugFlag, __VA_ARGS__); }} while(0)
|
||||
|
||||
#define EMPTY_BLOCK_POLL_IDLE_DURATION 10
|
||||
#define DEFAULT_AUTO_COMMIT_INTERVAL 5000
|
||||
|
@ -356,7 +356,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
|
|||
conf->autoCommit = false;
|
||||
return TMQ_CONF_OK;
|
||||
} else {
|
||||
tqErrorC("invalid value for enable.auto.commit: %s", value);
|
||||
tqErrorC("invalid value for enable.auto.commit:%s", value);
|
||||
return TMQ_CONF_INVALID;
|
||||
}
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
|
|||
int64_t tmp;
|
||||
code = taosStr2int64(value, &tmp);
|
||||
if (tmp < 0 || code != 0) {
|
||||
tqErrorC("invalid value for auto.commit.interval.ms: %s", value);
|
||||
tqErrorC("invalid value for auto.commit.interval.ms:%s", value);
|
||||
return TMQ_CONF_INVALID;
|
||||
}
|
||||
conf->autoCommitInterval = (tmp > INT32_MAX ? INT32_MAX : tmp);
|
||||
|
@ -376,7 +376,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
|
|||
int64_t tmp;
|
||||
code = taosStr2int64(value, &tmp);
|
||||
if (tmp < 6000 || tmp > 1800000 || code != 0) {
|
||||
tqErrorC("invalid value for session.timeout.ms: %s", value);
|
||||
tqErrorC("invalid value for session.timeout.ms:%s", value);
|
||||
return TMQ_CONF_INVALID;
|
||||
}
|
||||
conf->sessionTimeoutMs = tmp;
|
||||
|
@ -387,7 +387,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
|
|||
int64_t tmp;
|
||||
code = taosStr2int64(value, &tmp);
|
||||
if (tmp < 1000 || tmp >= conf->sessionTimeoutMs || code != 0) {
|
||||
tqErrorC("invalid value for heartbeat.interval.ms: %s", value);
|
||||
tqErrorC("invalid value for heartbeat.interval.ms:%s", value);
|
||||
return TMQ_CONF_INVALID;
|
||||
}
|
||||
conf->heartBeatIntervalMs = tmp;
|
||||
|
@ -398,7 +398,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
|
|||
int32_t tmp;
|
||||
code = taosStr2int32(value, &tmp);
|
||||
if (tmp < 1000 || code != 0) {
|
||||
tqErrorC("invalid value for max.poll.interval.ms: %s", value);
|
||||
tqErrorC("invalid value for max.poll.interval.ms:%s", value);
|
||||
return TMQ_CONF_INVALID;
|
||||
}
|
||||
conf->maxPollIntervalMs = tmp;
|
||||
|
@ -416,7 +416,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
|
|||
conf->resetOffset = TMQ_OFFSET__RESET_LATEST;
|
||||
return TMQ_CONF_OK;
|
||||
} else {
|
||||
tqErrorC("invalid value for auto.offset.reset: %s", value);
|
||||
tqErrorC("invalid value for auto.offset.reset:%s", value);
|
||||
return TMQ_CONF_INVALID;
|
||||
}
|
||||
}
|
||||
|
@ -429,7 +429,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
|
|||
conf->withTbName = false;
|
||||
return TMQ_CONF_OK;
|
||||
} else {
|
||||
tqErrorC("invalid value for msg.with.table.name: %s", value);
|
||||
tqErrorC("invalid value for msg.with.table.name:%s", value);
|
||||
return TMQ_CONF_INVALID;
|
||||
}
|
||||
}
|
||||
|
@ -442,7 +442,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
|
|||
conf->snapEnable = false;
|
||||
return TMQ_CONF_OK;
|
||||
} else {
|
||||
tqErrorC("invalid value for experimental.snapshot.enable: %s", value);
|
||||
tqErrorC("invalid value for experimental.snapshot.enable:%s", value);
|
||||
return TMQ_CONF_INVALID;
|
||||
}
|
||||
}
|
||||
|
@ -481,7 +481,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
|
|||
int64_t tmp;
|
||||
code = taosStr2int64(value, &tmp);
|
||||
if (tmp <= 0 || tmp > 65535 || code != 0) {
|
||||
tqErrorC("invalid value for td.connect.port: %s", value);
|
||||
tqErrorC("invalid value for td.connect.port:%s", value);
|
||||
return TMQ_CONF_INVALID;
|
||||
}
|
||||
|
||||
|
@ -497,7 +497,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
|
|||
conf->replayEnable = false;
|
||||
return TMQ_CONF_OK;
|
||||
} else {
|
||||
tqErrorC("invalid value for enable.replay: %s", value);
|
||||
tqErrorC("invalid value for enable.replay:%s", value);
|
||||
return TMQ_CONF_INVALID;
|
||||
}
|
||||
}
|
||||
|
@ -518,7 +518,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
|
|||
int64_t tmp = 0;
|
||||
code = taosStr2int64(value, &tmp);
|
||||
if (tmp <= 0 || tmp > INT32_MAX || code != 0) {
|
||||
tqErrorC("invalid value for fetch.max.wait.ms: %s", value);
|
||||
tqErrorC("invalid value for fetch.max.wait.ms:%s", value);
|
||||
return TMQ_CONF_INVALID;
|
||||
}
|
||||
conf->maxPollWaitTime = tmp;
|
||||
|
@ -529,7 +529,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
|
|||
int64_t tmp = 0;
|
||||
code = taosStr2int64(value, &tmp);
|
||||
if (tmp <= 0 || tmp > INT32_MAX || code != 0) {
|
||||
tqErrorC("invalid value for min.poll.rows: %s", value);
|
||||
tqErrorC("invalid value for min.poll.rows:%s", value);
|
||||
return TMQ_CONF_INVALID;
|
||||
}
|
||||
conf->minPollRows = tmp;
|
||||
|
@ -547,7 +547,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
|
|||
return TMQ_CONF_OK;
|
||||
}
|
||||
|
||||
tqErrorC("unknown key: %s", key);
|
||||
tqErrorC("unknown key:%s", key);
|
||||
return TMQ_CONF_UNKNOWN;
|
||||
}
|
||||
|
||||
|
@ -1268,7 +1268,7 @@ static void buildNewTopicList(tmq_t* tmq, SArray* newTopics, const SMqAskEpRsp*
|
|||
SMqClientTopic* pTopicCur = taosArrayGet(tmq->clientTopics, i);
|
||||
if (pTopicCur && pTopicCur->vgs) {
|
||||
int32_t vgNumCur = taosArrayGetSize(pTopicCur->vgs);
|
||||
tqInfoC("consumer:0x%" PRIx64 ", current vg num: %d", tmq->consumerId, vgNumCur);
|
||||
tqInfoC("consumer:0x%" PRIx64 ", current vg num:%d", tmq->consumerId, vgNumCur);
|
||||
for (int32_t j = 0; j < vgNumCur; j++) {
|
||||
SMqClientVg* pVgCur = taosArrayGet(pTopicCur->vgs, j);
|
||||
if (pVgCur == NULL) {
|
||||
|
@ -1474,7 +1474,7 @@ static int32_t askEp(tmq_t* pTmq, void* param, bool sync, bool updateEpSet) {
|
|||
pParam = NULL;
|
||||
|
||||
SEpSet epSet = getEpSet_s(&pTmq->pTscObj->pAppInfo->mgmtEp);
|
||||
tqDebugC("consumer:0x%" PRIx64 " ask ep from mnode,QID:0x%" PRIx64, pTmq->consumerId, sendInfo->requestId);
|
||||
tqDebugC("consumer:0x%" PRIx64 " ask ep from mnode, QID:0x%" PRIx64, pTmq->consumerId, sendInfo->requestId);
|
||||
code = asyncSendMsgToServer(pTmq->pTscObj->pAppInfo->pTransporter, &epSet, NULL, sendInfo);
|
||||
|
||||
END:
|
||||
|
@ -2102,7 +2102,7 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
goto END;
|
||||
}
|
||||
rspType = ((SMqRspHead*)pMsg->pData)->mqMsgType;
|
||||
tqDebugC("consumer:0x%" PRIx64 " recv poll rsp, vgId:%d, type %d(%s),QID:0x%" PRIx64, tmq->consumerId, vgId, rspType, tmqMsgTypeStr[rspType], requestId);
|
||||
tqDebugC("consumer:0x%" PRIx64 " recv poll rsp, vgId:%d, type %d(%s), QID:0x%" PRIx64, tmq->consumerId, vgId, rspType, tmqMsgTypeStr[rspType], requestId);
|
||||
|
||||
pRspWrapper->tmqRspType = rspType;
|
||||
pRspWrapper->pollRsp.reqId = requestId;
|
||||
|
@ -2123,7 +2123,7 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
taosFreeQitem(pRspWrapper);
|
||||
tqErrorC("consumer:0x%" PRIx64 " put poll res into mqueue failed, code:%d", tmq->consumerId, code);
|
||||
} else {
|
||||
tqDebugC("consumer:0x%" PRIx64 " put poll res into mqueue, type:%d(%s), vgId:%d, total in queue:%d,QID:0x%" PRIx64,
|
||||
tqDebugC("consumer:0x%" PRIx64 " put poll res into mqueue, type:%d(%s), vgId:%d, total in queue:%d, QID:0x%" PRIx64,
|
||||
tmq ? tmq->consumerId : 0, rspType, tmqMsgTypeStr[rspType], vgId, taosQueueItemSize(tmq->mqueue), requestId);
|
||||
}
|
||||
}
|
||||
|
@ -2297,7 +2297,7 @@ static int32_t doTmqPollImpl(tmq_t* pTmq, SMqClientTopic* pTopic, SMqClientVg* p
|
|||
char offsetFormatBuf[TSDB_OFFSET_LEN] = {0};
|
||||
tFormatOffset(offsetFormatBuf, tListLen(offsetFormatBuf), &pVg->offsetInfo.endOffset);
|
||||
code = asyncSendMsgToServer(pTmq->pTscObj->pAppInfo->pTransporter, &pVg->epSet, NULL, sendInfo);
|
||||
tqDebugC("consumer:0x%" PRIx64 " send poll to %s vgId:%d, code:%d, epoch %d, req:%s,QID:0x%" PRIx64, pTmq->consumerId,
|
||||
tqDebugC("consumer:0x%" PRIx64 " send poll to %s vgId:%d, code:%d, epoch %d, req:%s, QID:0x%" PRIx64, pTmq->consumerId,
|
||||
pTopic->topicName, pVg->vgId, code, pTmq->epoch, offsetFormatBuf, req.reqId);
|
||||
TSDB_CHECK_CODE(code, lino, END);
|
||||
|
||||
|
@ -2523,7 +2523,7 @@ static SMqRspObj* processMqRsp(tmq_t* tmq, SMqRspWrapper* pRspWrapper){
|
|||
tFormatOffset(buf, TSDB_OFFSET_LEN, &pollRspWrapper->rspOffset);
|
||||
if (pollRspWrapper->dataRsp.blockNum == 0) {
|
||||
tqDebugC("consumer:0x%" PRIx64 " empty block received, vgId:%d, offset:%s, vg total:%" PRId64
|
||||
", total:%" PRId64 ",QID:0x%" PRIx64,
|
||||
", total:%" PRId64 ", QID:0x%" PRIx64,
|
||||
tmq->consumerId, pVg->vgId, buf, pVg->numOfRows, tmq->totalRows, pollRspWrapper->reqId);
|
||||
pVg->emptyBlockReceiveTs = taosGetTimestampMs();
|
||||
} else {
|
||||
|
@ -2551,7 +2551,7 @@ static SMqRspObj* processMqRsp(tmq_t* tmq, SMqRspWrapper* pRspWrapper){
|
|||
}
|
||||
}
|
||||
tqDebugC("consumer:0x%" PRIx64 " process poll rsp, vgId:%d, offset:%s, blocks:%d, rows:%" PRId64
|
||||
", vg total:%" PRId64 ", total:%" PRId64 ",QID:0x%" PRIx64,
|
||||
", vg total:%" PRId64 ", total:%" PRId64 ", QID:0x%" PRIx64,
|
||||
tmq->consumerId, pVg->vgId, buf, pRspObj->dataRsp.blockNum, numOfRows, pVg->numOfRows, tmq->totalRows,
|
||||
pollRspWrapper->reqId);
|
||||
}
|
||||
|
@ -3551,7 +3551,7 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
|
|||
char offsetFormatBuf[TSDB_OFFSET_LEN] = {0};
|
||||
tFormatOffset(offsetFormatBuf, tListLen(offsetFormatBuf), &pClientVg->offsetInfo.beginOffset);
|
||||
|
||||
tqInfoC("consumer:0x%" PRIx64 " %s retrieve wal info vgId:%d, epoch %d, req:%s,QID:0x%" PRIx64, tmq->consumerId,
|
||||
tqInfoC("consumer:0x%" PRIx64 " %s retrieve wal info vgId:%d, epoch %d, req:%s, QID:0x%" PRIx64, tmq->consumerId,
|
||||
pTopic->topicName, pClientVg->vgId, tmq->epoch, offsetFormatBuf, req.reqId);
|
||||
code = asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &pClientVg->epSet, NULL, sendInfo);
|
||||
if (code != 0) {
|
||||
|
|
|
@ -184,7 +184,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqConsumerNewIm
|
|||
}
|
||||
tmq_t *tmq = tmq_consumer_new((tmq_conf_t *)conf, msg, len);
|
||||
if (strlen(msg) > 0) {
|
||||
jniError("jobj:%p, config:%p, tmq create consumer error: %s", jobj, conf, msg);
|
||||
jniError("jobj:%p, config:%p, tmq create consumer error:%s", jobj, conf, msg);
|
||||
(*env)->CallVoidMethod(env, jconsumer, g_createConsumerErrorCallback, (*env)->NewStringUTF(env, msg));
|
||||
taosMemoryFreeClear(msg);
|
||||
return TMQ_CONSUMER_CREATE_ERROR;
|
||||
|
@ -264,7 +264,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqSubscriptionIm
|
|||
int32_t res = tmq_subscription((tmq_t *)tmq, &topicList);
|
||||
if (res != JNI_SUCCESS) {
|
||||
tmq_list_destroy(topicList);
|
||||
jniError("jobj:%p, tmq:%p, tmq get subscription error: %s", jobj, tmq, tmq_err2str(res));
|
||||
jniError("jobj:%p, tmq:%p, tmq get subscription error:%s", jobj, tmq, tmq_err2str(res));
|
||||
return (jint)res;
|
||||
}
|
||||
|
||||
|
|
|
@ -1926,7 +1926,7 @@ TEST(stmt2Case, async_order) {
|
|||
auto start_time = std::chrono::steady_clock::now();
|
||||
while (!stop_task) {
|
||||
auto elapsed_time = std::chrono::steady_clock::now() - start_time;
|
||||
if (std::chrono::duration_cast<std::chrono::seconds>(elapsed_time).count() > 60) {
|
||||
if (std::chrono::duration_cast<std::chrono::seconds>(elapsed_time).count() > 100) {
|
||||
FAIL() << "Test[stmt2_async_test] timed out";
|
||||
t.detach();
|
||||
break;
|
||||
|
|
|
@ -866,3 +866,28 @@ int32_t tDecodeStreamTaskRunReq(SDecoder* pDecoder, SStreamTaskRunReq* pReq) {
|
|||
_exit:
|
||||
return code;
|
||||
}
|
||||
|
||||
int32_t tEncodeStreamTaskStopReq(SEncoder* pEncoder, const SStreamTaskStopReq* pReq) {
|
||||
int32_t code = 0;
|
||||
int32_t lino;
|
||||
|
||||
TAOS_CHECK_EXIT(tStartEncode(pEncoder));
|
||||
TAOS_CHECK_EXIT(tEncodeI64(pEncoder, pReq->streamId));
|
||||
tEndEncode(pEncoder);
|
||||
|
||||
_exit:
|
||||
return code;
|
||||
}
|
||||
|
||||
int32_t tDecodeStreamTaskStopReq(SDecoder* pDecoder, SStreamTaskStopReq* pReq) {
|
||||
int32_t code = 0;
|
||||
int32_t lino;
|
||||
|
||||
TAOS_CHECK_EXIT(tStartDecode(pDecoder));
|
||||
TAOS_CHECK_EXIT(tDecodeI64(pDecoder, &pReq->streamId));
|
||||
tEndDecode(pDecoder);
|
||||
|
||||
_exit:
|
||||
return code;
|
||||
|
||||
}
|
||||
|
|
|
@ -1476,6 +1476,7 @@ int32_t tSerializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) {
|
|||
TAOS_CHECK_EXIT(tEncodeI64(&encoder, pload->syncAppliedIndex));
|
||||
TAOS_CHECK_EXIT(tEncodeI64(&encoder, pload->syncCommitIndex));
|
||||
}
|
||||
TAOS_CHECK_EXIT(tEncodeI64(&encoder, pReq->timestamp));
|
||||
|
||||
TAOS_CHECK_EXIT(tEncodeI64(&encoder, pReq->timestamp));
|
||||
|
||||
|
|
|
@ -1982,15 +1982,15 @@ _exit:
|
|||
|
||||
static int32_t taosCheckGlobalCfg() {
|
||||
uint32_t ipv4 = 0;
|
||||
uInfo("start to check global tsLocalFqdn:%s, tsServerPort:%u", tsLocalFqdn, tsServerPort);
|
||||
uInfo("check global fqdn:%s and port:%u", tsLocalFqdn, tsServerPort);
|
||||
int32_t code = taosGetIpv4FromFqdn(tsLocalFqdn, &ipv4);
|
||||
if (code) {
|
||||
uError("failed to get ip from fqdn:%s since %s, dnode can not be initialized", tsLocalFqdn, tstrerror(code));
|
||||
uError("failed to get ip from fqdn:%s since %s, can not be initialized", tsLocalFqdn, tstrerror(code));
|
||||
TAOS_RETURN(TSDB_CODE_RPC_FQDN_ERROR);
|
||||
}
|
||||
|
||||
if (tsServerPort <= 0) {
|
||||
uError("invalid server port:%u, dnode can not be initialized", tsServerPort);
|
||||
uError("invalid server port:%u, can not be initialized", tsServerPort);
|
||||
TAOS_RETURN(TSDB_CODE_RPC_FQDN_ERROR);
|
||||
}
|
||||
|
||||
|
@ -2829,7 +2829,7 @@ static void taosCheckAndSetDebugFlag(int32_t *pFlagPtr, char *name, int32_t flag
|
|||
if (code != TSDB_CODE_CFG_NOT_FOUND) {
|
||||
uError("failed to set flag %s to %d, since:%s", name, flag, tstrerror(code));
|
||||
} else {
|
||||
uDebug("failed to set flag %s to %d, since:%s", name, flag, tstrerror(code));
|
||||
uTrace("failed to set flag %s to %d, since:%s", name, flag, tstrerror(code));
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -39,7 +39,7 @@ static void dmUpdateDnodeCfg(SDnodeMgmt *pMgmt, SDnodeCfg *pCfg) {
|
|||
auditSetDnodeId(pCfg->dnodeId);
|
||||
code = dmWriteEps(pMgmt->pData);
|
||||
if (code != 0) {
|
||||
dInfo("failed to set local info, dnodeId:%d clusterId:%" PRId64 " reason:%s", pCfg->dnodeId, pCfg->clusterId,
|
||||
dInfo("failed to set local info, dnodeId:%d clusterId:0x%" PRIx64 " reason:%s", pCfg->dnodeId, pCfg->clusterId,
|
||||
tstrerror(code));
|
||||
}
|
||||
(void)taosThreadRwlockUnlock(&pMgmt->pData->lock);
|
||||
|
|
|
@ -307,7 +307,7 @@ static void *dmCrashReportThreadFp(void *param) {
|
|||
truncateFile = true;
|
||||
}
|
||||
} else {
|
||||
dDebug("no crash info");
|
||||
dInfo("no crash info was found");
|
||||
}
|
||||
|
||||
taosMemoryFree(pMsg);
|
||||
|
|
|
@ -258,6 +258,7 @@ SArray *mmGetMsgHandles() {
|
|||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_CHECK_POINT_SOURCE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_UPDATE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_RESET_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_ALL_STOP_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_HEARTBEAT, mmPutMsgToReadQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_CHKPT_REPORT, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_REQ_CHKPT, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
|
|
|
@ -34,7 +34,7 @@ static int32_t mmRequire(const SMgmtInputOpt *pInput, bool *required) {
|
|||
if (!option.deploy) {
|
||||
*required = mmDeployRequired(pInput);
|
||||
if (*required) {
|
||||
dInfo("deploy mnode required. dnodeId:%d<=0, clusterId:%" PRId64 "<=0, localEp:%s==firstEp",
|
||||
dInfo("deploy mnode required. dnodeId:%d<=0, clusterId:0x%" PRIx64 "<=0, localEp:%s==firstEp",
|
||||
pInput->pData->dnodeId, pInput->pData->clusterId, tsLocalEp);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -96,6 +96,7 @@ SArray *smGetMsgHandles() {
|
|||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_CHECK, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_CHECK_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_RESET, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_ALL_STOP, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_GET_STREAM_PROGRESS, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_HEARTBEAT_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_REQ_CHKPT_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
|
||||
|
|
|
@ -32,6 +32,7 @@ typedef struct SVnodeMgmt {
|
|||
const char *name;
|
||||
SQueryAutoQWorkerPool queryPool;
|
||||
SAutoQWorkerPool streamPool;
|
||||
SAutoQWorkerPool streamLongExecPool;
|
||||
SWWorkerPool streamCtrlPool;
|
||||
SWWorkerPool fetchPool;
|
||||
SSingleWorker mgmtWorker;
|
||||
|
@ -75,6 +76,7 @@ typedef struct {
|
|||
STaosQueue *pQueryQ;
|
||||
STaosQueue *pStreamQ;
|
||||
STaosQueue *pStreamCtrlQ;
|
||||
STaosQueue *pStreamLongExecQ;
|
||||
STaosQueue *pFetchQ;
|
||||
STaosQueue *pMultiMgmQ;
|
||||
} SVnodeObj;
|
||||
|
@ -137,6 +139,8 @@ int32_t vmPutMsgToQueryQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
|
|||
int32_t vmPutMsgToFetchQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
|
||||
int32_t vmPutMsgToStreamQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
|
||||
int32_t vmPutMsgToStreamCtrlQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
|
||||
int32_t vmPutMsgToStreamLongExecQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
|
||||
|
||||
int32_t vmPutMsgToMergeQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
|
||||
int32_t vmPutMsgToMgmtQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
|
||||
int32_t vmPutMsgToMultiMgmtQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
|
||||
|
|
|
@ -1008,27 +1008,32 @@ SArray *vmGetMsgHandles() {
|
|||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RUN, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DISPATCH, vmPutMsgToStreamCtrlQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DISPATCH_RSP, vmPutMsgToStreamCtrlQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE_RSP, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_CHECK, vmPutMsgToStreamCtrlQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_CHECK_RSP, vmPutMsgToStreamCtrlQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_PAUSE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RESUME, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_STOP, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_CHECK_POINT_SOURCE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_CHECKPOINT_READY, vmPutMsgToStreamCtrlQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_CHECKPOINT_READY_RSP, vmPutMsgToStreamCtrlQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE_TRIGGER, vmPutMsgToStreamCtrlQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE_TRIGGER_RSP, vmPutMsgToStreamCtrlQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_UPDATE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_RESET, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_ALL_STOP, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_HEARTBEAT_RSP, vmPutMsgToStreamCtrlQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_REQ_CHKPT_RSP, vmPutMsgToStreamCtrlQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_CHKPT_REPORT_RSP, vmPutMsgToStreamCtrlQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_SCAN_HISTORY, vmPutMsgToStreamLongExecQueue, 0) == NULL) goto _OVER;
|
||||
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_GET_STREAM_PROGRESS, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE_RSP, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
|
||||
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_UPDATE_CHKPT, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_CONSEN_CHKPT, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_PAUSE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RESUME, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_STOP, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_CHECK_POINT_SOURCE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_UPDATE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_RESET, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_REPLICA, vmPutMsgToMgmtQueue, 0) == NULL) goto _OVER;
|
||||
if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_CONFIG, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
|
||||
|
|
|
@ -398,10 +398,14 @@ void vmCloseVnode(SVnodeMgmt *pMgmt, SVnodeObj *pVnode, bool commitAndRemoveWal,
|
|||
|
||||
dInfo("vgId:%d, wait for vnode stream queue:%p is empty, %d remains", pVnode->vgId,
|
||||
pVnode->pStreamQ, taosQueueItemSize(pVnode->pStreamQ));
|
||||
while (!taosQueueEmpty(pVnode->pStreamQ)) taosMsleep(10);
|
||||
while (!taosQueueEmpty(pVnode->pStreamQ)) taosMsleep(50);
|
||||
|
||||
dInfo("vgId:%d, wait for vnode stream ctrl queue:%p is empty", pVnode->vgId, pVnode->pStreamCtrlQ);
|
||||
while (!taosQueueEmpty(pVnode->pStreamCtrlQ)) taosMsleep(10);
|
||||
while (!taosQueueEmpty(pVnode->pStreamCtrlQ)) taosMsleep(50);
|
||||
|
||||
dInfo("vgId:%d, wait for vnode stream long-exec queue:%p is empty, %d remains", pVnode->vgId,
|
||||
pVnode->pStreamLongExecQ, taosQueueItemSize(pVnode->pStreamLongExecQ));
|
||||
while (!taosQueueEmpty(pVnode->pStreamLongExecQ)) taosMsleep(50);
|
||||
|
||||
dInfo("vgId:%d, all vnode queues is empty", pVnode->vgId);
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ static void vmProcessStreamCtrlQueue(SQueueInfo *pInfo, STaosQall* pQall, int32_
|
|||
SRpcMsg *pMsg = pItem;
|
||||
const STraceId *trace = &pMsg->info.traceId;
|
||||
|
||||
dGTrace("vgId:%d, msg:%p get from vnode-ctrl-stream queue", pVnode->vgId, pMsg);
|
||||
dGTrace("vgId:%d, msg:%p get from vnode-stream-ctrl queue", pVnode->vgId, pMsg);
|
||||
code = vnodeProcessStreamCtrlMsg(pVnode->pImpl, pMsg, pInfo);
|
||||
if (code != 0) {
|
||||
terrno = code;
|
||||
|
@ -165,6 +165,26 @@ static void vmProcessStreamCtrlQueue(SQueueInfo *pInfo, STaosQall* pQall, int32_
|
|||
}
|
||||
}
|
||||
|
||||
static void vmProcessStreamLongExecQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
|
||||
SVnodeObj *pVnode = pInfo->ahandle;
|
||||
const STraceId *trace = &pMsg->info.traceId;
|
||||
int32_t code = 0;
|
||||
|
||||
dGTrace("vgId:%d, msg:%p get from vnode-stream long-exec queue", pVnode->vgId, pMsg);
|
||||
|
||||
code = vnodeProcessStreamLongExecMsg(pVnode->pImpl, pMsg, pInfo);
|
||||
if (code != 0) {
|
||||
terrno = code;
|
||||
dGError("vgId:%d, msg:%p failed to process stream msg %s since %s", pVnode->vgId, pMsg, TMSG_INFO(pMsg->msgType),
|
||||
tstrerror(code));
|
||||
vmSendRsp(pMsg, code);
|
||||
}
|
||||
|
||||
dGTrace("vgId:%d, msg:%p is freed, code:0x%x", pVnode->vgId, pMsg, code);
|
||||
rpcFreeCont(pMsg->pCont);
|
||||
taosFreeQitem(pMsg);
|
||||
}
|
||||
|
||||
static void vmProcessFetchQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) {
|
||||
SVnodeObj *pVnode = pInfo->ahandle;
|
||||
SRpcMsg *pMsg = NULL;
|
||||
|
@ -274,9 +294,13 @@ static int32_t vmPutMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg, EQueueType qtyp
|
|||
code = taosWriteQitem(pVnode->pStreamQ, pMsg);
|
||||
break;
|
||||
case STREAM_CTRL_QUEUE:
|
||||
dGTrace("vgId:%d, msg:%p put into vnode-ctrl-stream queue", pVnode->vgId, pMsg);
|
||||
dGTrace("vgId:%d, msg:%p put into vnode-stream-ctrl queue", pVnode->vgId, pMsg);
|
||||
code = taosWriteQitem(pVnode->pStreamCtrlQ, pMsg);
|
||||
break;
|
||||
case STREAM_LONG_EXEC_QUEUE:
|
||||
dGTrace("vgId:%d, msg:%p put into vnode-stream-long-exec queue", pVnode->vgId, pMsg);
|
||||
code = taosWriteQitem(pVnode->pStreamLongExecQ, pMsg);
|
||||
break;
|
||||
case FETCH_QUEUE:
|
||||
dGTrace("vgId:%d, msg:%p put into vnode-fetch queue", pVnode->vgId, pMsg);
|
||||
code = taosWriteQitem(pVnode->pFetchQ, pMsg);
|
||||
|
@ -335,6 +359,8 @@ int32_t vmPutMsgToStreamQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { return vmPutMs
|
|||
|
||||
int32_t vmPutMsgToStreamCtrlQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { return vmPutMsgToQueue(pMgmt, pMsg, STREAM_CTRL_QUEUE); }
|
||||
|
||||
int32_t vmPutMsgToStreamLongExecQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { return vmPutMsgToQueue(pMgmt, pMsg, STREAM_LONG_EXEC_QUEUE); }
|
||||
|
||||
int32_t vmPutMsgToMultiMgmtQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
|
||||
const STraceId *trace = &pMsg->info.traceId;
|
||||
dGTrace("msg:%p, put into vnode-multi-mgmt queue", pMsg);
|
||||
|
@ -409,6 +435,10 @@ int32_t vmGetQueueSize(SVnodeMgmt *pMgmt, int32_t vgId, EQueueType qtype) {
|
|||
break;
|
||||
case STREAM_CTRL_QUEUE:
|
||||
size = taosQueueItemSize(pVnode->pStreamCtrlQ);
|
||||
break;
|
||||
case STREAM_LONG_EXEC_QUEUE:
|
||||
size = taosQueueItemSize(pVnode->pStreamLongExecQ);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -451,13 +481,16 @@ int32_t vmAllocQueue(SVnodeMgmt *pMgmt, SVnodeObj *pVnode) {
|
|||
}
|
||||
|
||||
pVnode->pQueryQ = tQueryAutoQWorkerAllocQueue(&pMgmt->queryPool, pVnode, (FItem)vmProcessQueryQueue);
|
||||
pVnode->pStreamQ = tAutoQWorkerAllocQueue(&pMgmt->streamPool, pVnode, (FItem)vmProcessStreamQueue);
|
||||
pVnode->pFetchQ = tWWorkerAllocQueue(&pMgmt->fetchPool, pVnode, (FItems)vmProcessFetchQueue);
|
||||
|
||||
// init stream msg processing queue family
|
||||
pVnode->pStreamQ = tAutoQWorkerAllocQueue(&pMgmt->streamPool, pVnode, (FItem)vmProcessStreamQueue, 2);
|
||||
pVnode->pStreamCtrlQ = tWWorkerAllocQueue(&pMgmt->streamCtrlPool, pVnode, (FItems)vmProcessStreamCtrlQueue);
|
||||
pVnode->pStreamLongExecQ = tAutoQWorkerAllocQueue(&pMgmt->streamLongExecPool, pVnode, (FItem)vmProcessStreamLongExecQueue, 1);
|
||||
|
||||
if (pVnode->pWriteW.queue == NULL || pVnode->pSyncW.queue == NULL || pVnode->pSyncRdW.queue == NULL ||
|
||||
pVnode->pApplyW.queue == NULL || pVnode->pQueryQ == NULL || pVnode->pStreamQ == NULL || pVnode->pFetchQ == NULL
|
||||
|| pVnode->pStreamCtrlQ == NULL) {
|
||||
|| pVnode->pStreamCtrlQ == NULL || pVnode->pStreamLongExecQ == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
@ -473,6 +506,7 @@ int32_t vmAllocQueue(SVnodeMgmt *pMgmt, SVnodeObj *pVnode) {
|
|||
dInfo("vgId:%d, fetch-queue:%p is alloced, thread:%08" PRId64, pVnode->vgId, pVnode->pFetchQ,
|
||||
taosQueueGetThreadId(pVnode->pFetchQ));
|
||||
dInfo("vgId:%d, stream-queue:%p is alloced", pVnode->vgId, pVnode->pStreamQ);
|
||||
dInfo("vgId:%d, stream-long-exec-queue:%p is alloced", pVnode->vgId, pVnode->pStreamLongExecQ);
|
||||
dInfo("vgId:%d, stream-ctrl-queue:%p is alloced, thread:%08" PRId64, pVnode->vgId, pVnode->pStreamCtrlQ,
|
||||
taosQueueGetThreadId(pVnode->pStreamCtrlQ));
|
||||
return 0;
|
||||
|
@ -481,17 +515,22 @@ int32_t vmAllocQueue(SVnodeMgmt *pMgmt, SVnodeObj *pVnode) {
|
|||
void vmFreeQueue(SVnodeMgmt *pMgmt, SVnodeObj *pVnode) {
|
||||
tQueryAutoQWorkerFreeQueue(&pMgmt->queryPool, pVnode->pQueryQ);
|
||||
tAutoQWorkerFreeQueue(&pMgmt->streamPool, pVnode->pStreamQ);
|
||||
tAutoQWorkerFreeQueue(&pMgmt->streamLongExecPool, pVnode->pStreamLongExecQ);
|
||||
tWWorkerFreeQueue(&pMgmt->streamCtrlPool, pVnode->pStreamCtrlQ);
|
||||
tWWorkerFreeQueue(&pMgmt->fetchPool, pVnode->pFetchQ);
|
||||
pVnode->pQueryQ = NULL;
|
||||
pVnode->pFetchQ = NULL;
|
||||
|
||||
pVnode->pStreamQ = NULL;
|
||||
pVnode->pStreamCtrlQ = NULL;
|
||||
pVnode->pFetchQ = NULL;
|
||||
pVnode->pStreamLongExecQ = NULL;
|
||||
|
||||
dDebug("vgId:%d, queue is freed", pVnode->vgId);
|
||||
}
|
||||
|
||||
int32_t vmStartWorker(SVnodeMgmt *pMgmt) {
|
||||
int32_t code = 0;
|
||||
int32_t code = 0;
|
||||
|
||||
SQueryAutoQWorkerPool *pQPool = &pMgmt->queryPool;
|
||||
pQPool->name = "vnode-query";
|
||||
pQPool->min = tsNumOfVnodeQueryThreads;
|
||||
|
@ -505,8 +544,13 @@ int32_t vmStartWorker(SVnodeMgmt *pMgmt) {
|
|||
pStreamPool->ratio = tsRatioOfVnodeStreamThreads;
|
||||
if ((code = tAutoQWorkerInit(pStreamPool)) != 0) return code;
|
||||
|
||||
SAutoQWorkerPool *pLongExecPool = &pMgmt->streamLongExecPool;
|
||||
pLongExecPool->name = "vnode-stream-long-exec";
|
||||
pLongExecPool->ratio = tsRatioOfVnodeStreamThreads/3;
|
||||
if ((code = tAutoQWorkerInit(pLongExecPool)) != 0) return code;
|
||||
|
||||
SWWorkerPool *pStreamCtrlPool = &pMgmt->streamCtrlPool;
|
||||
pStreamCtrlPool->name = "vnode-ctrl-stream";
|
||||
pStreamCtrlPool->name = "vnode-stream-ctrl";
|
||||
pStreamCtrlPool->max = 1;
|
||||
if ((code = tWWorkerInit(pStreamCtrlPool)) != 0) return code;
|
||||
|
||||
|
@ -541,6 +585,7 @@ int32_t vmStartWorker(SVnodeMgmt *pMgmt) {
|
|||
void vmStopWorker(SVnodeMgmt *pMgmt) {
|
||||
tQueryAutoQWorkerCleanup(&pMgmt->queryPool);
|
||||
tAutoQWorkerCleanup(&pMgmt->streamPool);
|
||||
tAutoQWorkerCleanup(&pMgmt->streamLongExecPool);
|
||||
tWWorkerCleanup(&pMgmt->streamCtrlPool);
|
||||
tWWorkerCleanup(&pMgmt->fetchPool);
|
||||
dDebug("vnode workers are closed");
|
||||
|
|
|
@ -48,10 +48,10 @@ extern "C" {
|
|||
|
||||
#define dFatal(...) { if (dDebugFlag & DEBUG_FATAL) { taosPrintLog("DND FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }}
|
||||
#define dError(...) { if (dDebugFlag & DEBUG_ERROR) { taosPrintLog("DND ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }}
|
||||
#define dWarn(...) { if (dDebugFlag & DEBUG_WARN) { taosPrintLog("DND WARN ", DEBUG_WARN, 255, __VA_ARGS__); }}
|
||||
#define dInfo(...) { if (dDebugFlag & DEBUG_INFO) { taosPrintLog("DND ", DEBUG_INFO, 255, __VA_ARGS__); }}
|
||||
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
|
||||
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
|
||||
#define dWarn(...) { if (dDebugFlag & DEBUG_WARN) { taosPrintLog("DND WARN ", DEBUG_WARN, 255, __VA_ARGS__); }}
|
||||
#define dInfo(...) { if (dDebugFlag & DEBUG_INFO) { taosPrintLog("DND INFO ", DEBUG_INFO, 255, __VA_ARGS__); }}
|
||||
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND DEBUG ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
|
||||
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND TRACE ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
|
||||
|
||||
#define encryptDebug(...) { \
|
||||
if (toLogFile) { \
|
||||
|
@ -83,12 +83,12 @@ extern "C" {
|
|||
}\
|
||||
}
|
||||
|
||||
#define dGFatal(param, ...) {if (dDebugFlag & DEBUG_FATAL) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dFatal(param ",QID:%s", __VA_ARGS__, buf);}}
|
||||
#define dGError(param, ...) {if (dDebugFlag & DEBUG_ERROR) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dError(param ",QID:%s", __VA_ARGS__, buf);}}
|
||||
#define dGWarn(param, ...) {if (dDebugFlag & DEBUG_WARN) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dWarn(param ",QID:%s", __VA_ARGS__, buf);}}
|
||||
#define dGInfo(param, ...) {if (dDebugFlag & DEBUG_INFO) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dInfo(param ",QID:%s", __VA_ARGS__, buf);}}
|
||||
#define dGDebug(param, ...) {if (dDebugFlag & DEBUG_DEBUG) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dDebug(param ",QID:%s", __VA_ARGS__, buf);}}
|
||||
#define dGTrace(param, ...) {if (dDebugFlag & DEBUG_TRACE) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dTrace(param ",QID:%s", __VA_ARGS__, buf);}}
|
||||
#define dGFatal(param, ...) {if (dDebugFlag & DEBUG_FATAL) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dFatal(param ", QID:%s", __VA_ARGS__, buf);}}
|
||||
#define dGError(param, ...) {if (dDebugFlag & DEBUG_ERROR) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dError(param ", QID:%s", __VA_ARGS__, buf);}}
|
||||
#define dGWarn(param, ...) {if (dDebugFlag & DEBUG_WARN) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dWarn(param ", QID:%s", __VA_ARGS__, buf);}}
|
||||
#define dGInfo(param, ...) {if (dDebugFlag & DEBUG_INFO) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dInfo(param ", QID:%s", __VA_ARGS__, buf);}}
|
||||
#define dGDebug(param, ...) {if (dDebugFlag & DEBUG_DEBUG) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dDebug(param ", QID:%s", __VA_ARGS__, buf);}}
|
||||
#define dGTrace(param, ...) {if (dDebugFlag & DEBUG_TRACE) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dTrace(param ", QID:%s", __VA_ARGS__, buf);}}
|
||||
|
||||
// clang-format on
|
||||
|
||||
|
|
|
@ -37,17 +37,17 @@ extern "C" {
|
|||
// clang-format off
|
||||
#define mFatal(...) { if (mDebugFlag & DEBUG_FATAL) { taosPrintLog("MND FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }}
|
||||
#define mError(...) { if (mDebugFlag & DEBUG_ERROR) { taosPrintLog("MND ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }}
|
||||
#define mWarn(...) { if (mDebugFlag & DEBUG_WARN) { taosPrintLog("MND WARN ", DEBUG_WARN, 255, __VA_ARGS__); }}
|
||||
#define mInfo(...) { if (mDebugFlag & DEBUG_INFO) { taosPrintLog("MND ", DEBUG_INFO, 255, __VA_ARGS__); }}
|
||||
#define mDebug(...) { if (mDebugFlag & DEBUG_DEBUG) { taosPrintLog("MND ", DEBUG_DEBUG, mDebugFlag, __VA_ARGS__); }}
|
||||
#define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", DEBUG_TRACE, mDebugFlag, __VA_ARGS__); }}
|
||||
#define mWarn(...) { if (mDebugFlag & DEBUG_WARN) { taosPrintLog("MND WARN ", DEBUG_WARN, 255, __VA_ARGS__); }}
|
||||
#define mInfo(...) { if (mDebugFlag & DEBUG_INFO) { taosPrintLog("MND INFO ", DEBUG_INFO, 255, __VA_ARGS__); }}
|
||||
#define mDebug(...) { if (mDebugFlag & DEBUG_DEBUG) { taosPrintLog("MND DEBUG ", DEBUG_DEBUG, mDebugFlag, __VA_ARGS__); }}
|
||||
#define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND TRACE ", DEBUG_TRACE, mDebugFlag, __VA_ARGS__); }}
|
||||
|
||||
#define mGFatal(param, ...) { if (mDebugFlag & DEBUG_FATAL){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mFatal(param ",QID:%s", __VA_ARGS__, buf);}}
|
||||
#define mGError(param, ...) { if (mDebugFlag & DEBUG_ERROR){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mError(param ",QID:%s", __VA_ARGS__, buf);}}
|
||||
#define mGWarn(param, ...) { if (mDebugFlag & DEBUG_WARN){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mWarn (param ",QID:%s", __VA_ARGS__, buf);}}
|
||||
#define mGInfo(param, ...) { if (mDebugFlag & DEBUG_INFO){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mInfo (param ",QID:%s", __VA_ARGS__, buf);}}
|
||||
#define mGDebug(param, ...) { if (mDebugFlag & DEBUG_DEBUG){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mDebug(param ",QID:%s", __VA_ARGS__, buf);}}
|
||||
#define mGTrace(param, ...) { if (mDebugFlag & DEBUG_TRACE){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mTrace(param ",QID:%s", __VA_ARGS__, buf);}}
|
||||
#define mGFatal(param, ...) { if (mDebugFlag & DEBUG_FATAL){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mFatal(param ", QID:%s", __VA_ARGS__, buf);}}
|
||||
#define mGError(param, ...) { if (mDebugFlag & DEBUG_ERROR){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mError(param ", QID:%s", __VA_ARGS__, buf);}}
|
||||
#define mGWarn(param, ...) { if (mDebugFlag & DEBUG_WARN) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); mWarn (param ", QID:%s", __VA_ARGS__, buf);}}
|
||||
#define mGInfo(param, ...) { if (mDebugFlag & DEBUG_INFO) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); mInfo (param ", QID:%s", __VA_ARGS__, buf);}}
|
||||
#define mGDebug(param, ...) { if (mDebugFlag & DEBUG_DEBUG){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mDebug(param ", QID:%s", __VA_ARGS__, buf);}}
|
||||
#define mGTrace(param, ...) { if (mDebugFlag & DEBUG_TRACE){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mTrace(param ", QID:%s", __VA_ARGS__, buf);}}
|
||||
// clang-format on
|
||||
|
||||
#define SYSTABLE_SCH_TABLE_NAME_LEN ((TSDB_TABLE_NAME_LEN - 1) + VARSTR_HEADER_SIZE)
|
||||
|
|
|
@ -151,6 +151,8 @@ int32_t mndStreamSetChkptIdAction(SMnode *pMnode, STrans *pTrans, SStreamTask *p
|
|||
int32_t mndStreamSetRestartAction(SMnode *pMnode, STrans *pTrans, SStreamObj *pStream);
|
||||
int32_t mndStreamSetCheckpointAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTask, int64_t checkpointId,
|
||||
int8_t mndTrigger);
|
||||
int32_t mndStreamSetStopStreamTasksActions(SMnode* pMnode, STrans *pTrans, uint64_t dbUid);
|
||||
|
||||
int32_t mndCreateStreamChkptInfoUpdateTrans(SMnode *pMnode, SStreamObj *pStream, SArray *pChkptInfoList);
|
||||
int32_t mndScanCheckpointReportInfo(SRpcMsg *pReq);
|
||||
int32_t mndCreateSetConsensusChkptIdTrans(SMnode *pMnode, SStreamObj *pStream, int32_t taskId, int64_t checkpointId,
|
||||
|
|
|
@ -299,6 +299,8 @@ _OVER:
|
|||
}
|
||||
sdbRelease(pMnode->pSdb, vObj);
|
||||
cfgArrayCleanUp(array);
|
||||
|
||||
tFreeSConfigReq(&configReq);
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
|
@ -1714,6 +1714,7 @@ static int32_t mndDropDb(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb) {
|
|||
#endif
|
||||
TAOS_CHECK_GOTO(mndDropSmasByDb(pMnode, pTrans, pDb), NULL, _OVER);
|
||||
TAOS_CHECK_GOTO(mndDropIdxsByDb(pMnode, pTrans, pDb), NULL, _OVER);
|
||||
TAOS_CHECK_GOTO(mndStreamSetStopStreamTasksActions(pMnode, pTrans, pDb->uid), NULL, _OVER);
|
||||
TAOS_CHECK_GOTO(mndSetDropDbRedoActions(pMnode, pTrans, pDb), NULL, _OVER);
|
||||
TAOS_CHECK_GOTO(mndUserRemoveDb(pMnode, pTrans, pDb->name), NULL, _OVER);
|
||||
|
||||
|
|
|
@ -778,7 +778,7 @@ static int32_t mndProcessKillQueryReq(SRpcMsg *pReq) {
|
|||
uint64_t queryId = 0;
|
||||
char *p = strchr(killReq.queryStrId, ':');
|
||||
if (NULL == p) {
|
||||
mError("invalid query id %s", killReq.queryStrId);
|
||||
mError("invalid QID:%s", killReq.queryStrId);
|
||||
code = TSDB_CODE_MND_INVALID_QUERY_ID;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
|
|
@ -116,6 +116,7 @@ int32_t mndInitStream(SMnode *pMnode) {
|
|||
mndSetMsgHandle(pMnode, TDMT_STREAM_DROP_RSP, mndTransProcessRsp);
|
||||
|
||||
mndSetMsgHandle(pMnode, TDMT_VND_STREAM_CHECK_POINT_SOURCE_RSP, mndTransProcessRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_VND_STREAM_ALL_STOP_RSP, mndTransProcessRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_STREAM_BEGIN_CHECKPOINT, mndProcessStreamCheckpoint);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_STREAM_DROP_ORPHANTASKS, mndProcessDropOrphanTaskReq);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_STREAM_TASK_RESET, mndProcessResetStatusReq);
|
||||
|
@ -2013,15 +2014,16 @@ static int32_t mndProcessResetStreamReq(SRpcMsg *pReq) {
|
|||
return TSDB_CODE_ACTION_IN_PROGRESS;
|
||||
}
|
||||
|
||||
static int32_t mndProcessVgroupChange(SMnode *pMnode, SVgroupChangeInfo *pChangeInfo, bool includeAllNodes) {
|
||||
static int32_t mndProcessVgroupChange(SMnode *pMnode, SVgroupChangeInfo *pChangeInfo, bool includeAllNodes, STrans** pUpdateTrans) {
|
||||
SSdb *pSdb = pMnode->pSdb;
|
||||
SStreamObj *pStream = NULL;
|
||||
void *pIter = NULL;
|
||||
STrans *pTrans = NULL;
|
||||
int32_t code = 0;
|
||||
*pUpdateTrans = NULL;
|
||||
|
||||
// conflict check for nodeUpdate trans, here we randomly chose one stream to add into the trans pool
|
||||
while (1) {
|
||||
SStreamObj *pStream = NULL;
|
||||
pIter = sdbFetch(pSdb, SDB_STREAM, pIter, (void **)&pStream);
|
||||
if (pIter == NULL) {
|
||||
break;
|
||||
|
@ -2038,6 +2040,7 @@ static int32_t mndProcessVgroupChange(SMnode *pMnode, SVgroupChangeInfo *pChange
|
|||
}
|
||||
|
||||
while (1) {
|
||||
SStreamObj *pStream = NULL;
|
||||
pIter = sdbFetch(pSdb, SDB_STREAM, pIter, (void **)&pStream);
|
||||
if (pIter == NULL) {
|
||||
break;
|
||||
|
@ -2058,7 +2061,7 @@ static int32_t mndProcessVgroupChange(SMnode *pMnode, SVgroupChangeInfo *pChange
|
|||
void *p1 = taosHashGet(pChangeInfo->pDBMap, pStream->targetDb, strlen(pStream->targetDb));
|
||||
void *p2 = taosHashGet(pChangeInfo->pDBMap, pStream->sourceDb, strlen(pStream->sourceDb));
|
||||
if (p1 == NULL && p2 == NULL) {
|
||||
mDebug("stream:0x%" PRIx64 " %s not involved nodeUpdate, ignore", pStream->uid, pStream->name);
|
||||
mDebug("stream:0x%" PRIx64 " %s not involved in nodeUpdate, ignore", pStream->uid, pStream->name);
|
||||
sdbRelease(pSdb, pStream);
|
||||
continue;
|
||||
}
|
||||
|
@ -2093,20 +2096,7 @@ static int32_t mndProcessVgroupChange(SMnode *pMnode, SVgroupChangeInfo *pChange
|
|||
}
|
||||
|
||||
// no need to build the trans to handle the vgroup update
|
||||
if (pTrans == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
code = mndTransPrepare(pMnode, pTrans);
|
||||
if (code != TSDB_CODE_SUCCESS && code != TSDB_CODE_ACTION_IN_PROGRESS) {
|
||||
mError("trans:%d, failed to prepare update stream trans since %s", pTrans->id, tstrerror(code));
|
||||
sdbRelease(pMnode->pSdb, pStream);
|
||||
mndTransDrop(pTrans);
|
||||
return code;
|
||||
}
|
||||
|
||||
sdbRelease(pMnode->pSdb, pStream);
|
||||
mndTransDrop(pTrans);
|
||||
*pUpdateTrans = pTrans;
|
||||
return code;
|
||||
}
|
||||
|
||||
|
@ -2188,7 +2178,7 @@ static int32_t refreshNodeListFromExistedStreams(SMnode *pMnode, SArray *pNodeLi
|
|||
|
||||
taosHashCleanup(pHash);
|
||||
|
||||
mDebug("numOfNodes:%d for stream after extract nodeInfo from stream", (int32_t)taosArrayGetSize(pNodeList));
|
||||
mDebug("numOfvNodes:%d get after extracting nodeInfo from all streams", (int32_t)taosArrayGetSize(pNodeList));
|
||||
return code;
|
||||
}
|
||||
|
||||
|
@ -2212,14 +2202,49 @@ static void addAllDbsIntoHashmap(SHashObj *pDBMap, SSdb *pSdb) {
|
|||
}
|
||||
}
|
||||
|
||||
static int32_t doProcessNodeCheckHelp(SArray *pNodeSnapshot, SMnode *pMnode, SVgroupChangeInfo *pChangeInfo,
|
||||
bool *pUpdateAllVgroups) {
|
||||
int32_t code = removeExpiredNodeEntryAndTaskInBuf(pNodeSnapshot);
|
||||
if (code) {
|
||||
mDebug("failed to remove expired node entry in buf, code:%s", tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
code = mndFindChangedNodeInfo(pMnode, execInfo.pNodeList, pNodeSnapshot, pChangeInfo);
|
||||
if (code) {
|
||||
mDebug("failed to find changed vnode(s) during vnode(s) check, code:%s", tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
{
|
||||
if (execInfo.role == NODE_ROLE_LEADER && execInfo.switchFromFollower) {
|
||||
mInfo("rollback all stream due to mnode leader/follower switch by using nodeUpdate trans");
|
||||
*pUpdateAllVgroups = true;
|
||||
execInfo.switchFromFollower = false; // reset the flag
|
||||
addAllDbsIntoHashmap(pChangeInfo->pDBMap, pMnode->pSdb);
|
||||
}
|
||||
}
|
||||
|
||||
if (taosArrayGetSize(pChangeInfo->pUpdateNodeList) > 0 || (*pUpdateAllVgroups)) {
|
||||
// kill current active checkpoint transaction, since the transaction is vnode wide.
|
||||
killAllCheckpointTrans(pMnode, pChangeInfo);
|
||||
} else {
|
||||
mDebug("no update found in vnode(s) list");
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
// this function runs by only one thread, so it is not multi-thread safe
|
||||
static int32_t mndProcessNodeCheckReq(SRpcMsg *pMsg) {
|
||||
int32_t code = 0;
|
||||
bool allReady = true;
|
||||
SArray *pNodeSnapshot = NULL;
|
||||
SMnode *pMnode = pMsg->info.node;
|
||||
int64_t ts = taosGetTimestampSec();
|
||||
bool updateAllVgroups = false;
|
||||
int32_t code = 0;
|
||||
bool allReady = true;
|
||||
SArray *pNodeSnapshot = NULL;
|
||||
SMnode *pMnode = pMsg->info.node;
|
||||
int64_t tsms = taosGetTimestampMs();
|
||||
int64_t ts = tsms / 1000;
|
||||
bool updateAllVgroups = false;
|
||||
SVgroupChangeInfo changeInfo = {0};
|
||||
|
||||
int32_t old = atomic_val_compare_exchange_32(&mndNodeCheckSentinel, 0, 1);
|
||||
if (old != 0) {
|
||||
|
@ -2227,7 +2252,7 @@ static int32_t mndProcessNodeCheckReq(SRpcMsg *pMsg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
mDebug("start to do node changing check");
|
||||
mDebug("start to do node changing check, ts:%" PRId64, tsms);
|
||||
|
||||
streamMutexLock(&execInfo.lock);
|
||||
int32_t numOfNodes = extractStreamNodeList(pMnode);
|
||||
|
@ -2253,58 +2278,60 @@ static int32_t mndProcessNodeCheckReq(SRpcMsg *pMsg) {
|
|||
}
|
||||
|
||||
streamMutexLock(&execInfo.lock);
|
||||
code = doProcessNodeCheckHelp(pNodeSnapshot, pMnode, &changeInfo, &updateAllVgroups);
|
||||
streamMutexUnlock(&execInfo.lock);
|
||||
|
||||
code = removeExpiredNodeEntryAndTaskInBuf(pNodeSnapshot);
|
||||
if (code) {
|
||||
goto _end;
|
||||
}
|
||||
|
||||
SVgroupChangeInfo changeInfo = {0};
|
||||
code = mndFindChangedNodeInfo(pMnode, execInfo.pNodeList, pNodeSnapshot, &changeInfo);
|
||||
if (code) {
|
||||
goto _end;
|
||||
}
|
||||
|
||||
{
|
||||
if (execInfo.role == NODE_ROLE_LEADER && execInfo.switchFromFollower) {
|
||||
mInfo("rollback all stream due to mnode leader/follower switch by using nodeUpdate trans");
|
||||
updateAllVgroups = true;
|
||||
execInfo.switchFromFollower = false; // reset the flag
|
||||
addAllDbsIntoHashmap(changeInfo.pDBMap, pMnode->pSdb);
|
||||
}
|
||||
}
|
||||
|
||||
if (taosArrayGetSize(changeInfo.pUpdateNodeList) > 0 || updateAllVgroups) {
|
||||
// kill current active checkpoint transaction, since the transaction is vnode wide.
|
||||
killAllCheckpointTrans(pMnode, &changeInfo);
|
||||
code = mndProcessVgroupChange(pMnode, &changeInfo, updateAllVgroups);
|
||||
mDebug("vnode(s) change detected, build trans to update stream task epsets");
|
||||
|
||||
STrans *pTrans = NULL;
|
||||
|
||||
streamMutexLock(&execInfo.lock);
|
||||
code = mndProcessVgroupChange(pMnode, &changeInfo, updateAllVgroups, &pTrans);
|
||||
streamMutexUnlock(&execInfo.lock);
|
||||
|
||||
// NOTE: sync trans out of lock
|
||||
if (code == 0 && pTrans != NULL) {
|
||||
code = mndTransPrepare(pMnode, pTrans);
|
||||
if (code != TSDB_CODE_SUCCESS && code != TSDB_CODE_ACTION_IN_PROGRESS) {
|
||||
mError("trans:%d, failed to prepare update stream trans since %s", pTrans->id, tstrerror(code));
|
||||
}
|
||||
|
||||
mndTransDrop(pTrans);
|
||||
}
|
||||
|
||||
// keep the new vnode snapshot if success
|
||||
if (code == TSDB_CODE_SUCCESS || code == TSDB_CODE_ACTION_IN_PROGRESS) {
|
||||
streamMutexLock(&execInfo.lock);
|
||||
|
||||
code = refreshNodeListFromExistedStreams(pMnode, execInfo.pNodeList);
|
||||
int32_t num = (int)taosArrayGetSize(execInfo.pNodeList);
|
||||
if (code == 0) {
|
||||
execInfo.ts = ts;
|
||||
mDebug("create trans successfully, update cached node list, numOfNodes:%d", num);
|
||||
}
|
||||
|
||||
streamMutexUnlock(&execInfo.lock);
|
||||
|
||||
if (code) {
|
||||
mError("failed to extract node list from stream, code:%s", tstrerror(code));
|
||||
goto _end;
|
||||
}
|
||||
|
||||
execInfo.ts = ts;
|
||||
mDebug("create trans successfully, update cached node list, numOfNodes:%d",
|
||||
(int)taosArrayGetSize(execInfo.pNodeList));
|
||||
} else {
|
||||
mError("unexpected code during create nodeUpdate trans, code:%s", tstrerror(code));
|
||||
}
|
||||
} else {
|
||||
mDebug("no update found in nodeList");
|
||||
}
|
||||
|
||||
mndDestroyVgroupChangeInfo(&changeInfo);
|
||||
|
||||
_end:
|
||||
streamMutexUnlock(&execInfo.lock);
|
||||
taosArrayDestroy(pNodeSnapshot);
|
||||
|
||||
mDebug("end to do stream task node change checking");
|
||||
mDebug("end to do stream task node change checking, elapsed time:%" PRId64 "ms", taosGetTimestampMs() - tsms);
|
||||
atomic_store_32(&mndNodeCheckSentinel, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2749,7 +2776,7 @@ int32_t mndProcessConsensusInTmr(SRpcMsg *pMsg) {
|
|||
int64_t now = taosGetTimestampMs();
|
||||
bool allReady = true;
|
||||
SArray *pNodeSnapshot = NULL;
|
||||
int32_t maxAllowedTrans = 50;
|
||||
int32_t maxAllowedTrans = 20;
|
||||
int32_t numOfTrans = 0;
|
||||
int32_t code = 0;
|
||||
void *pIter = NULL;
|
||||
|
@ -2836,6 +2863,7 @@ int32_t mndProcessConsensusInTmr(SRpcMsg *pMsg) {
|
|||
return TSDB_CODE_FAILED;
|
||||
}
|
||||
|
||||
// todo: check for redundant consensus-checkpoint trans, if this kinds of trans repeatly failed.
|
||||
code = mndCreateSetConsensusChkptIdTrans(pMnode, pStream, pe->req.taskId, chkId, pe->req.startTs);
|
||||
if (code != TSDB_CODE_SUCCESS && code != TSDB_CODE_ACTION_IN_PROGRESS) {
|
||||
mError("failed to create consensus-checkpoint trans, stream:0x%" PRIx64, pStream->uid);
|
||||
|
@ -2859,7 +2887,7 @@ int32_t mndProcessConsensusInTmr(SRpcMsg *pMsg) {
|
|||
if (taosArrayGetSize(pInfo->pTaskList) == 0) {
|
||||
mndClearConsensusRspEntry(pInfo);
|
||||
if (streamId == -1) {
|
||||
mError("streamId is -1, streamId:%" PRIx64" in consensus-checkpointId hashMap, cont", pInfo->streamId);
|
||||
mError("streamId is -1, streamId:%" PRIx64 " in consensus-checkpointId hashMap, cont", pInfo->streamId);
|
||||
}
|
||||
|
||||
void *p = taosArrayPush(pStreamList, &streamId);
|
||||
|
|
|
@ -666,3 +666,75 @@ int32_t mndStreamSetRestartAction(SMnode* pMnode, STrans *pTrans, SStreamObj* pS
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int32_t doSetStopAllTasksAction(SMnode* pMnode, STrans* pTrans, SVgObj* pVgObj) {
|
||||
void *pBuf = NULL;
|
||||
int32_t len = 0;
|
||||
int32_t code = 0;
|
||||
SEncoder encoder;
|
||||
|
||||
SStreamTaskStopReq req = {.streamId = -1};
|
||||
tEncodeSize(tEncodeStreamTaskStopReq, &req, len, code);
|
||||
if (code < 0) {
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
int32_t tlen = sizeof(SMsgHead) + len;
|
||||
|
||||
pBuf = taosMemoryMalloc(tlen);
|
||||
if (pBuf == NULL) {
|
||||
return terrno;
|
||||
}
|
||||
|
||||
void *abuf = POINTER_SHIFT(pBuf, sizeof(SMsgHead));
|
||||
tEncoderInit(&encoder, abuf, tlen);
|
||||
code = tEncodeStreamTaskStopReq(&encoder, &req);
|
||||
if (code == -1) {
|
||||
tEncoderClear(&encoder);
|
||||
taosMemoryFree(pBuf);
|
||||
return code;
|
||||
}
|
||||
|
||||
SMsgHead *pMsgHead = (SMsgHead *)pBuf;
|
||||
pMsgHead->contLen = htonl(tlen);
|
||||
pMsgHead->vgId = htonl(pVgObj->vgId);
|
||||
|
||||
tEncoderClear(&encoder);
|
||||
|
||||
SEpSet epset = mndGetVgroupEpset(pMnode, pVgObj);
|
||||
mndReleaseVgroup(pMnode, pVgObj);
|
||||
|
||||
code = setTransAction(pTrans, pBuf, tlen, TDMT_VND_STREAM_ALL_STOP, &epset, 0, TSDB_CODE_VND_INVALID_VGROUP_ID);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
mError("failed to create stop all streams trans, code:%s", tstrerror(code));
|
||||
taosMemoryFree(pBuf);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t mndStreamSetStopStreamTasksActions(SMnode* pMnode, STrans *pTrans, uint64_t dbUid) {
|
||||
int32_t code = 0;
|
||||
SSdb *pSdb = pMnode->pSdb;
|
||||
void *pIter = NULL;
|
||||
|
||||
while (1) {
|
||||
SVgObj *pVgroup = NULL;
|
||||
pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup);
|
||||
if (pIter == NULL) break;
|
||||
|
||||
if (pVgroup->dbUid == dbUid) {
|
||||
if ((code = doSetStopAllTasksAction(pMnode, pTrans, pVgroup)) != 0) {
|
||||
sdbCancelFetch(pSdb, pIter);
|
||||
sdbRelease(pSdb, pVgroup);
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
}
|
||||
|
||||
sdbRelease(pSdb, pVgroup);
|
||||
}
|
||||
|
||||
TAOS_RETURN(code);
|
||||
return 0;
|
||||
}
|
|
@ -31,10 +31,10 @@ extern "C" {
|
|||
// clang-format off
|
||||
#define mFatal(...) { if (mDebugFlag & DEBUG_FATAL) { taosPrintLog("MND FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }}
|
||||
#define mError(...) { if (mDebugFlag & DEBUG_ERROR) { taosPrintLog("MND ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }}
|
||||
#define mWarn(...) { if (mDebugFlag & DEBUG_WARN) { taosPrintLog("MND WARN ", DEBUG_WARN, 255, __VA_ARGS__); }}
|
||||
#define mInfo(...) { if (mDebugFlag & DEBUG_INFO) { taosPrintLog("MND ", DEBUG_INFO, 255, __VA_ARGS__); }}
|
||||
#define mDebug(...) { if (mDebugFlag & DEBUG_DEBUG) { taosPrintLog("MND ", DEBUG_DEBUG, mDebugFlag, __VA_ARGS__); }}
|
||||
#define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", DEBUG_TRACE, mDebugFlag, __VA_ARGS__); }}
|
||||
#define mWarn(...) { if (mDebugFlag & DEBUG_WARN) { taosPrintLog("MND WARN ", DEBUG_WARN, 255, __VA_ARGS__); }}
|
||||
#define mInfo(...) { if (mDebugFlag & DEBUG_INFO) { taosPrintLog("MND INFO ", DEBUG_INFO, 255, __VA_ARGS__); }}
|
||||
#define mDebug(...) { if (mDebugFlag & DEBUG_DEBUG) { taosPrintLog("MND DEBUG ", DEBUG_DEBUG, mDebugFlag, __VA_ARGS__); }}
|
||||
#define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND TRACE ", DEBUG_TRACE, mDebugFlag, __VA_ARGS__); }}
|
||||
// clang-format on
|
||||
|
||||
#define SDB_GET_VAL(pData, dataPos, val, pos, func, type) \
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
#include "tuuid.h"
|
||||
|
||||
// clang-format off
|
||||
#define sndError(...) do { if (sndDebugFlag & DEBUG_ERROR) {taosPrintLog("SND ERROR ", DEBUG_ERROR, sndDebugFlag, __VA_ARGS__);}} while (0)
|
||||
#define sndInfo(...) do { if (sndDebugFlag & DEBUG_INFO) { taosPrintLog("SND INFO ", DEBUG_INFO, sndDebugFlag, __VA_ARGS__);}} while (0)
|
||||
#define sndDebug(...) do { if (sndDebugFlag & DEBUG_DEBUG) { taosPrintLog("SND ", DEBUG_DEBUG, sndDebugFlag, __VA_ARGS__);}} while (0)
|
||||
#define sndError(...) do { if (sndDebugFlag & DEBUG_ERROR) { taosPrintLog("SND ERROR ", DEBUG_ERROR, sndDebugFlag, __VA_ARGS__);}} while (0)
|
||||
#define sndInfo(...) do { if (sndDebugFlag & DEBUG_INFO) { taosPrintLog("SND INFO ", DEBUG_INFO, sndDebugFlag, __VA_ARGS__);}} while (0)
|
||||
#define sndDebug(...) do { if (sndDebugFlag & DEBUG_DEBUG) { taosPrintLog("SND DEBUG ", DEBUG_DEBUG, sndDebugFlag, __VA_ARGS__);}} while (0)
|
||||
// clang-format on
|
||||
|
||||
int32_t sndBuildStreamTask(SSnode *pSnode, SStreamTask *pTask, int64_t nextProcessVer) {
|
||||
|
@ -157,9 +157,11 @@ int32_t sndProcessWriteMsg(SSnode *pSnode, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
|||
case TDMT_STREAM_TASK_DROP:
|
||||
return tqStreamTaskProcessDropReq(pSnode->pMeta, pMsg->pCont, pMsg->contLen);
|
||||
case TDMT_VND_STREAM_TASK_UPDATE:
|
||||
return tqStreamTaskProcessUpdateReq(pSnode->pMeta, &pSnode->msgCb, pMsg, true);
|
||||
return tqStreamTaskProcessUpdateReq(pSnode->pMeta, &pSnode->msgCb, pMsg, true, true);
|
||||
case TDMT_VND_STREAM_TASK_RESET:
|
||||
return tqStreamTaskProcessTaskResetReq(pSnode->pMeta, pMsg->pCont);
|
||||
case TDMT_VND_STREAM_ALL_STOP:
|
||||
return tqStreamTaskProcessAllTaskStopReq(pSnode->pMeta, &pSnode->msgCb, pMsg);
|
||||
case TDMT_STREAM_TASK_PAUSE:
|
||||
return tqStreamTaskProcessTaskPauseReq(pSnode->pMeta, pMsg->pCont);
|
||||
case TDMT_STREAM_TASK_RESUME:
|
||||
|
|
|
@ -113,6 +113,7 @@ int32_t vnodeProcessQueryMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo);
|
|||
int32_t vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo);
|
||||
int32_t vnodeProcessStreamMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo);
|
||||
int32_t vnodeProcessStreamCtrlMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo);
|
||||
int32_t vnodeProcessStreamLongExecMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo);
|
||||
void vnodeProposeWriteMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs);
|
||||
void vnodeApplyWriteMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs);
|
||||
void vnodeProposeCommitOnNeed(SVnode *pVnode, bool atExit);
|
||||
|
|
|
@ -29,12 +29,12 @@ typedef struct SMetaCache SMetaCache;
|
|||
|
||||
// metaDebug ==================
|
||||
// clang-format off
|
||||
#define metaFatal(...) do { if (metaDebugFlag & DEBUG_FATAL) { taosPrintLog("MTA FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0)
|
||||
#define metaError(...) do { if (metaDebugFlag & DEBUG_ERROR) { taosPrintLog("MTA ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0)
|
||||
#define metaWarn(...) do { if (metaDebugFlag & DEBUG_WARN) { taosPrintLog("MTA WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0)
|
||||
#define metaInfo(...) do { if (metaDebugFlag & DEBUG_INFO) { taosPrintLog("MTA ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0)
|
||||
#define metaDebug(...) do { if (metaDebugFlag & DEBUG_DEBUG) { taosPrintLog("MTA ", DEBUG_DEBUG, metaDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define metaTrace(...) do { if (metaDebugFlag & DEBUG_TRACE) { taosPrintLog("MTA ", DEBUG_TRACE, metaDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define metaFatal(...) do { if (metaDebugFlag & DEBUG_FATAL) { taosPrintLog("MTA FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0)
|
||||
#define metaError(...) do { if (metaDebugFlag & DEBUG_ERROR) { taosPrintLog("MTA ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0)
|
||||
#define metaWarn(...) do { if (metaDebugFlag & DEBUG_WARN) { taosPrintLog("MTA WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0)
|
||||
#define metaInfo(...) do { if (metaDebugFlag & DEBUG_INFO) { taosPrintLog("MTA INFO ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0)
|
||||
#define metaDebug(...) do { if (metaDebugFlag & DEBUG_DEBUG) { taosPrintLog("MTA DEBUG ", DEBUG_DEBUG, metaDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define metaTrace(...) do { if (metaDebugFlag & DEBUG_TRACE) { taosPrintLog("MTA TRACE ", DEBUG_TRACE, metaDebugFlag, __VA_ARGS__); }} while(0)
|
||||
// clang-format on
|
||||
|
||||
// metaOpen ==================
|
||||
|
|
|
@ -24,12 +24,12 @@ extern "C" {
|
|||
|
||||
// smaDebug ================
|
||||
// clang-format off
|
||||
#define smaFatal(...) do { if (smaDebugFlag & DEBUG_FATAL) { taosPrintLog("SMA FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0)
|
||||
#define smaError(...) do { if (smaDebugFlag & DEBUG_ERROR) { taosPrintLog("SMA ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0)
|
||||
#define smaWarn(...) do { if (smaDebugFlag & DEBUG_WARN) { taosPrintLog("SMA WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0)
|
||||
#define smaInfo(...) do { if (smaDebugFlag & DEBUG_INFO) { taosPrintLog("SMA ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0)
|
||||
#define smaDebug(...) do { if (smaDebugFlag & DEBUG_DEBUG) { taosPrintLog("SMA ", DEBUG_DEBUG, tsdbDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define smaTrace(...) do { if (smaDebugFlag & DEBUG_TRACE) { taosPrintLog("SMA ", DEBUG_TRACE, tsdbDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define smaFatal(...) do { if (smaDebugFlag & DEBUG_FATAL) { taosPrintLog("SMA FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0)
|
||||
#define smaError(...) do { if (smaDebugFlag & DEBUG_ERROR) { taosPrintLog("SMA ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0)
|
||||
#define smaWarn(...) do { if (smaDebugFlag & DEBUG_WARN) { taosPrintLog("SMA WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0)
|
||||
#define smaInfo(...) do { if (smaDebugFlag & DEBUG_INFO) { taosPrintLog("SMA INFO ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0)
|
||||
#define smaDebug(...) do { if (smaDebugFlag & DEBUG_DEBUG) { taosPrintLog("SMA DEBUG ", DEBUG_DEBUG, tsdbDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define smaTrace(...) do { if (smaDebugFlag & DEBUG_TRACE) { taosPrintLog("SMA TRACE ", DEBUG_TRACE, tsdbDebugFlag, __VA_ARGS__); }} while(0)
|
||||
// clang-format on
|
||||
|
||||
#define RSMA_TASK_INFO_HASH_SLOT (8)
|
||||
|
|
|
@ -33,12 +33,12 @@ extern "C" {
|
|||
|
||||
// tqDebug ===================
|
||||
// clang-format off
|
||||
#define tqFatal(...) do { if (tqDebugFlag & DEBUG_FATAL) { taosPrintLog("TQ FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0)
|
||||
#define tqError(...) do { if (tqDebugFlag & DEBUG_ERROR) { taosPrintLog("TQ ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0)
|
||||
#define tqWarn(...) do { if (tqDebugFlag & DEBUG_WARN) { taosPrintLog("TQ WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0)
|
||||
#define tqInfo(...) do { if (tqDebugFlag & DEBUG_INFO) { taosPrintLog("TQ ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0)
|
||||
#define tqDebug(...) do { if (tqDebugFlag & DEBUG_DEBUG) { taosPrintLog("TQ ", DEBUG_DEBUG, tqDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tqTrace(...) do { if (tqDebugFlag & DEBUG_TRACE) { taosPrintLog("TQ ", DEBUG_TRACE, tqDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tqFatal(...) do { if (tqDebugFlag & DEBUG_FATAL) { taosPrintLog("TQ FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0)
|
||||
#define tqError(...) do { if (tqDebugFlag & DEBUG_ERROR) { taosPrintLog("TQ ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0)
|
||||
#define tqWarn(...) do { if (tqDebugFlag & DEBUG_WARN) { taosPrintLog("TQ WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0)
|
||||
#define tqInfo(...) do { if (tqDebugFlag & DEBUG_INFO) { taosPrintLog("TQ INFO ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0)
|
||||
#define tqDebug(...) do { if (tqDebugFlag & DEBUG_DEBUG) { taosPrintLog("TQ DEBUG ", DEBUG_DEBUG, tqDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tqTrace(...) do { if (tqDebugFlag & DEBUG_TRACE) { taosPrintLog("TQ TRACE ", DEBUG_TRACE, tqDebugFlag, __VA_ARGS__); }} while(0)
|
||||
// clang-format on
|
||||
|
||||
#define IS_OFFSET_RESET_TYPE(_t) ((_t) < 0)
|
||||
|
|
|
@ -28,12 +28,12 @@ extern "C" {
|
|||
|
||||
// tsdbDebug ================
|
||||
// clang-format off
|
||||
#define tsdbFatal(...) do { if (tsdbDebugFlag & DEBUG_FATAL) { taosPrintLog("TSD FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0)
|
||||
#define tsdbError(...) do { if (tsdbDebugFlag & DEBUG_ERROR) { taosPrintLog("TSD ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0)
|
||||
#define tsdbWarn(...) do { if (tsdbDebugFlag & DEBUG_WARN) { taosPrintLog("TSD WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0)
|
||||
#define tsdbInfo(...) do { if (tsdbDebugFlag & DEBUG_INFO) { taosPrintLog("TSD ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0)
|
||||
#define tsdbDebug(...) do { if (tsdbDebugFlag & DEBUG_DEBUG) { taosPrintLog("TSD ", DEBUG_DEBUG, tsdbDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tsdbTrace(...) do { if (tsdbDebugFlag & DEBUG_TRACE) { taosPrintLog("TSD ", DEBUG_TRACE, tsdbDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tsdbFatal(...) do { if (tsdbDebugFlag & DEBUG_FATAL) { taosPrintLog("TSD FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0)
|
||||
#define tsdbError(...) do { if (tsdbDebugFlag & DEBUG_ERROR) { taosPrintLog("TSD ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0)
|
||||
#define tsdbWarn(...) do { if (tsdbDebugFlag & DEBUG_WARN) { taosPrintLog("TSD WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0)
|
||||
#define tsdbInfo(...) do { if (tsdbDebugFlag & DEBUG_INFO) { taosPrintLog("TSD INFO ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0)
|
||||
#define tsdbDebug(...) do { if (tsdbDebugFlag & DEBUG_DEBUG) { taosPrintLog("TSD DEBUG ", DEBUG_DEBUG, tsdbDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define tsdbTrace(...) do { if (tsdbDebugFlag & DEBUG_TRACE) { taosPrintLog("TSD TRACE ", DEBUG_TRACE, tsdbDebugFlag, __VA_ARGS__); }} while(0)
|
||||
// clang-format on
|
||||
|
||||
typedef struct TSDBROW TSDBROW;
|
||||
|
|
|
@ -25,19 +25,19 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
// clang-format off
|
||||
#define vFatal(...) do { if (vDebugFlag & DEBUG_FATAL) { taosPrintLog("VND FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0)
|
||||
#define vError(...) do { if (vDebugFlag & DEBUG_ERROR) { taosPrintLog("VND ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0)
|
||||
#define vWarn(...) do { if (vDebugFlag & DEBUG_WARN) { taosPrintLog("VND WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0)
|
||||
#define vInfo(...) do { if (vDebugFlag & DEBUG_INFO) { taosPrintLog("VND ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0)
|
||||
#define vDebug(...) do { if (vDebugFlag & DEBUG_DEBUG) { taosPrintLog("VND ", DEBUG_DEBUG, vDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define vTrace(...) do { if (vDebugFlag & DEBUG_TRACE) { taosPrintLog("VND ", DEBUG_TRACE, vDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define vFatal(...) do { if (vDebugFlag & DEBUG_FATAL) { taosPrintLog("VND FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0)
|
||||
#define vError(...) do { if (vDebugFlag & DEBUG_ERROR) { taosPrintLog("VND ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0)
|
||||
#define vWarn(...) do { if (vDebugFlag & DEBUG_WARN) { taosPrintLog("VND WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0)
|
||||
#define vInfo(...) do { if (vDebugFlag & DEBUG_INFO) { taosPrintLog("VND INFO ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0)
|
||||
#define vDebug(...) do { if (vDebugFlag & DEBUG_DEBUG) { taosPrintLog("VND DEBUG ", DEBUG_DEBUG, vDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define vTrace(...) do { if (vDebugFlag & DEBUG_TRACE) { taosPrintLog("VND TRACE ", DEBUG_TRACE, vDebugFlag, __VA_ARGS__); }} while(0)
|
||||
|
||||
#define vGTrace(param, ...) do { if (vDebugFlag & DEBUG_TRACE) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); vTrace(param ",QID:%s", __VA_ARGS__, buf);}} while(0)
|
||||
#define vGFatal(param, ...) do { if (vDebugFlag & DEBUG_FATAL) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); vFatal(param ",QID:%s", __VA_ARGS__, buf);}} while(0)
|
||||
#define vGError(param, ...) do { if (vDebugFlag & DEBUG_ERROR) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); vError(param ",QID:%s", __VA_ARGS__, buf);}} while(0)
|
||||
#define vGWarn(param, ...) do { if (vDebugFlag & DEBUG_WARN) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); vWarn(param ",QID:%s", __VA_ARGS__, buf);}} while(0)
|
||||
#define vGInfo(param, ...) do { if (vDebugFlag & DEBUG_INFO) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); vInfo(param ",QID:%s", __VA_ARGS__, buf);}} while(0)
|
||||
#define vGDebug(param, ...) do { if (vDebugFlag & DEBUG_DEBUG) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); vDebug(param ",QID:%s", __VA_ARGS__, buf);}} while(0)
|
||||
#define vGTrace(param, ...) do { if (vDebugFlag & DEBUG_TRACE) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); vTrace(param ", QID:%s", __VA_ARGS__, buf);}} while(0)
|
||||
#define vGFatal(param, ...) do { if (vDebugFlag & DEBUG_FATAL) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); vFatal(param ", QID:%s", __VA_ARGS__, buf);}} while(0)
|
||||
#define vGError(param, ...) do { if (vDebugFlag & DEBUG_ERROR) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); vError(param ", QID:%s", __VA_ARGS__, buf);}} while(0)
|
||||
#define vGWarn(param, ...) do { if (vDebugFlag & DEBUG_WARN) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); vWarn(param ", QID:%s", __VA_ARGS__, buf);}} while(0)
|
||||
#define vGInfo(param, ...) do { if (vDebugFlag & DEBUG_INFO) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); vInfo(param ", QID:%s", __VA_ARGS__, buf);}} while(0)
|
||||
#define vGDebug(param, ...) do { if (vDebugFlag & DEBUG_DEBUG) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); vDebug(param ", QID:%s", __VA_ARGS__, buf);}} while(0)
|
||||
|
||||
// clang-format on
|
||||
|
||||
|
|
|
@ -242,14 +242,16 @@ void tqClose(STQ*);
|
|||
int tqPushMsg(STQ*, tmsg_t msgType);
|
||||
int tqRegisterPushHandle(STQ* pTq, void* handle, SRpcMsg* pMsg);
|
||||
void tqUnregisterPushHandle(STQ* pTq, void* pHandle);
|
||||
int tqScanWalAsync(STQ* pTq, bool ckPause);
|
||||
void tqScanWalAsync(STQ* pTq);
|
||||
int32_t tqStopStreamTasksAsync(STQ* pTq);
|
||||
int32_t tqStopStreamAllTasksAsync(SStreamMeta* pMeta, SMsgCb* pMsgCb);
|
||||
int32_t tqProcessTaskCheckPointSourceReq(STQ* pTq, SRpcMsg* pMsg, SRpcMsg* pRsp);
|
||||
int32_t tqProcessTaskCheckpointReadyMsg(STQ* pTq, SRpcMsg* pMsg);
|
||||
int32_t tqProcessTaskRetrieveTriggerReq(STQ* pTq, SRpcMsg* pMsg);
|
||||
int32_t tqProcessTaskRetrieveTriggerRsp(STQ* pTq, SRpcMsg* pMsg);
|
||||
int32_t tqProcessTaskUpdateReq(STQ* pTq, SRpcMsg* pMsg);
|
||||
int32_t tqProcessTaskResetReq(STQ* pTq, SRpcMsg* pMsg);
|
||||
int32_t tqProcessAllTaskStopReq(STQ* pTq, SRpcMsg* pMsg);
|
||||
int32_t tqProcessStreamHbRsp(STQ* pTq, SRpcMsg* pMsg);
|
||||
int32_t tqProcessStreamReqCheckpointRsp(STQ* pTq, SRpcMsg* pMsg);
|
||||
int32_t tqProcessTaskChkptReportRsp(STQ* pTq, SRpcMsg* pMsg);
|
||||
|
|
|
@ -1017,20 +1017,20 @@ int32_t tdProcessRSmaSubmit(SSma *pSma, int64_t version, void *pReq, void *pMsg,
|
|||
|
||||
int32_t code = 0;
|
||||
if ((code = atomic_load_32(&SMA_RSMA_STAT(pSma)->execStat))) {
|
||||
smaError("vgId:%d, failed to process rsma submit since invalid exec code: %s", SMA_VID(pSma), tstrerror(code));
|
||||
smaError("vgId:%d, failed to process rsma submit since invalid exec code:%s", SMA_VID(pSma), tstrerror(code));
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
STbUidStore uidStore = {0};
|
||||
|
||||
if ((code = tdFetchSubmitReqSuids(pReq, &uidStore)) < 0) {
|
||||
smaError("vgId:%d, failed to process rsma submit fetch suid since: %s", SMA_VID(pSma), tstrerror(code));
|
||||
smaError("vgId:%d, failed to process rsma submit fetch suid since %s", SMA_VID(pSma), tstrerror(code));
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
if (uidStore.suid != 0) {
|
||||
if ((code = tdExecuteRSmaAsync(pSma, version, pMsg, len, STREAM_INPUT__DATA_SUBMIT, uidStore.suid)) < 0) {
|
||||
smaError("vgId:%d, failed to process rsma submit exec 1 since: %s", SMA_VID(pSma), tstrerror(code));
|
||||
smaError("vgId:%d, failed to process rsma submit exec 1 since %s", SMA_VID(pSma), tstrerror(code));
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
|
@ -1054,13 +1054,13 @@ int32_t tdProcessRSmaDelete(SSma *pSma, int64_t version, void *pReq, void *pMsg,
|
|||
|
||||
int32_t code = 0;
|
||||
if ((code = atomic_load_32(&SMA_RSMA_STAT(pSma)->execStat))) {
|
||||
smaError("vgId:%d, failed to process rsma delete since invalid exec code: %s", SMA_VID(pSma), tstrerror(code));
|
||||
smaError("vgId:%d, failed to process rsma delete since invalid exec code:%s", SMA_VID(pSma), tstrerror(code));
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
SDeleteRes *pDelRes = pReq;
|
||||
if ((code = tdExecuteRSmaAsync(pSma, version, pMsg, len, STREAM_INPUT__REF_DATA_BLOCK, pDelRes->suid)) < 0) {
|
||||
smaError("vgId:%d, failed to process rsma submit exec 1 since: %s", SMA_VID(pSma), tstrerror(code));
|
||||
smaError("vgId:%d, failed to process rsma submit exec 1 since %s", SMA_VID(pSma), tstrerror(code));
|
||||
goto _exit;
|
||||
}
|
||||
_exit:
|
||||
|
@ -1249,7 +1249,7 @@ int32_t tdRSmaPersistExecImpl(SRSmaStat *pRSmaStat, SHashObj *pInfoHash) {
|
|||
if (streamFlushed) {
|
||||
pRSmaInfo->items[i].streamFlushed = 1;
|
||||
if (++nStreamFlushed >= nTaskInfo) {
|
||||
smaInfo("vgId:%d, rsma commit, checkpoint ready, %d us consumed, received/total: %d/%d", TD_VID(pVnode),
|
||||
smaInfo("vgId:%d, rsma commit, checkpoint ready, %d us consumed, received/total:%d/%d", TD_VID(pVnode),
|
||||
nSleep * 10, nStreamFlushed, nTaskInfo);
|
||||
taosHashCancelIterate(pInfoHash, infoHash);
|
||||
goto _checkpoint;
|
||||
|
@ -1260,7 +1260,7 @@ int32_t tdRSmaPersistExecImpl(SRSmaStat *pRSmaStat, SHashObj *pInfoHash) {
|
|||
}
|
||||
taosUsleep(10);
|
||||
++nSleep;
|
||||
smaDebug("vgId:%d, rsma commit, wait for checkpoint ready, %d us elapsed, received/total: %d/%d", TD_VID(pVnode),
|
||||
smaDebug("vgId:%d, rsma commit, wait for checkpoint ready, %d us elapsed, received/total:%d/%d", TD_VID(pVnode),
|
||||
nSleep * 10, nStreamFlushed, nTaskInfo);
|
||||
}
|
||||
} while (0);
|
||||
|
@ -1302,7 +1302,7 @@ _checkpoint:
|
|||
}
|
||||
|
||||
streamMetaWLock(pMeta);
|
||||
if ((code = streamMetaSaveTask(pMeta, pTask)) != 0) {
|
||||
if ((code = streamMetaSaveTaskInMeta(pMeta, pTask)) != 0) {
|
||||
streamMetaWUnLock(pMeta);
|
||||
taosHashCancelIterate(pInfoHash, infoHash);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
|
|
@ -202,7 +202,7 @@ void tqPushEmptyDataRsp(STqHandle* pHandle, int32_t vgId) {
|
|||
dataRsp.blockNum = 0;
|
||||
char buf[TSDB_OFFSET_LEN] = {0};
|
||||
(void)tFormatOffset(buf, TSDB_OFFSET_LEN, &dataRsp.reqOffset);
|
||||
tqInfo("tqPushEmptyDataRsp to consumer:0x%" PRIx64 " vgId:%d, offset:%s,QID:0x%" PRIx64, req.consumerId, vgId, buf,
|
||||
tqInfo("tqPushEmptyDataRsp to consumer:0x%" PRIx64 " vgId:%d, offset:%s, QID:0x%" PRIx64, req.consumerId, vgId, buf,
|
||||
req.reqId);
|
||||
|
||||
code = tqSendDataRsp(pHandle, pHandle->msg, &req, &dataRsp, TMQ_MSG_TYPE__POLL_DATA_RSP, vgId);
|
||||
|
@ -225,7 +225,7 @@ int32_t tqSendDataRsp(STqHandle* pHandle, const SRpcMsg* pMsg, const SMqPollReq*
|
|||
(void)tFormatOffset(buf1, TSDB_OFFSET_LEN, &(pRsp->reqOffset));
|
||||
(void)tFormatOffset(buf2, TSDB_OFFSET_LEN, &(pRsp->rspOffset));
|
||||
|
||||
tqDebug("tmq poll vgId:%d consumer:0x%" PRIx64 " (epoch %d) start to send rsp, block num:%d, req:%s, rsp:%s,QID:0x%" PRIx64,
|
||||
tqDebug("tmq poll vgId:%d consumer:0x%" PRIx64 " (epoch %d) start to send rsp, block num:%d, req:%s, rsp:%s, QID:0x%" PRIx64,
|
||||
vgId, pReq->consumerId, pReq->epoch, pRsp->blockNum, buf1, buf2, pReq->reqId);
|
||||
|
||||
return tqDoSendDataRsp(&pMsg->info, pRsp, pReq->epoch, pReq->consumerId, type, sver, ever);
|
||||
|
@ -477,7 +477,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
|
|||
|
||||
char buf[TSDB_OFFSET_LEN] = {0};
|
||||
(void)tFormatOffset(buf, TSDB_OFFSET_LEN, &reqOffset);
|
||||
tqDebug("tmq poll: consumer:0x%" PRIx64 " (epoch %d), subkey %s, recv poll req vgId:%d, req:%s,QID:0x%" PRIx64,
|
||||
tqDebug("tmq poll: consumer:0x%" PRIx64 " (epoch %d), subkey %s, recv poll req vgId:%d, req:%s, QID:0x%" PRIx64,
|
||||
consumerId, req.epoch, pHandle->subKey, vgId, buf, req.reqId);
|
||||
|
||||
code = tqExtractDataForMq(pTq, pHandle, &req, pMsg);
|
||||
|
@ -928,12 +928,12 @@ static void doStartFillhistoryStep2(SStreamTask* pTask, SStreamTask* pStreamTask
|
|||
|
||||
// now the fill-history task starts to scan data from wal files.
|
||||
code = streamTaskHandleEvent(pTask->status.pSM, TASK_EVENT_SCANHIST_DONE);
|
||||
if (code == TSDB_CODE_SUCCESS) {
|
||||
code = tqScanWalAsync(pTq, false);
|
||||
if (code) {
|
||||
tqError("vgId:%d failed to start scan wal file, code:%s", vgId, tstrerror(code));
|
||||
}
|
||||
}
|
||||
// if (code == TSDB_CODE_SUCCESS) {
|
||||
// code = tqScanWalAsync(pTq, false);
|
||||
// if (code) {
|
||||
// tqError("vgId:%d failed to start scan wal file, code:%s", vgId, tstrerror(code));
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1121,23 +1121,14 @@ int32_t tqProcessTaskRunReq(STQ* pTq, SRpcMsg* pMsg) {
|
|||
// extracted submit data from wal files for all tasks
|
||||
if (req.reqType == STREAM_EXEC_T_EXTRACT_WAL_DATA) {
|
||||
return tqScanWal(pTq);
|
||||
}
|
||||
} else {
|
||||
code = tqStreamTaskProcessRunReq(pTq->pStreamMeta, pMsg, vnodeIsRoleLeader(pTq->pVnode));
|
||||
if (code) {
|
||||
tqError("vgId:%d failed to create task run req, code:%s", TD_VID(pTq->pVnode), tstrerror(code));
|
||||
}
|
||||
|
||||
code = tqStreamTaskProcessRunReq(pTq->pStreamMeta, pMsg, vnodeIsRoleLeader(pTq->pVnode));
|
||||
if (code) {
|
||||
tqError("vgId:%d failed to create task run req, code:%s", TD_VID(pTq->pVnode), tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
// let's continue scan data in the wal files
|
||||
if (req.reqType >= 0 || req.reqType == STREAM_EXEC_T_RESUME_TASK) {
|
||||
code = tqScanWalAsync(pTq, false); // it's ok to failed
|
||||
if (code) {
|
||||
tqError("vgId:%d failed to start scan wal file, code:%s", pTq->pStreamMeta->vgId, tstrerror(code));
|
||||
}
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
int32_t tqProcessTaskDispatchReq(STQ* pTq, SRpcMsg* pMsg) {
|
||||
|
@ -1381,13 +1372,18 @@ int32_t tqProcessTaskCheckpointReadyMsg(STQ* pTq, SRpcMsg* pMsg) {
|
|||
}
|
||||
|
||||
int32_t tqProcessTaskUpdateReq(STQ* pTq, SRpcMsg* pMsg) {
|
||||
return tqStreamTaskProcessUpdateReq(pTq->pStreamMeta, &pTq->pVnode->msgCb, pMsg, pTq->pVnode->restored);
|
||||
return tqStreamTaskProcessUpdateReq(pTq->pStreamMeta, &pTq->pVnode->msgCb, pMsg,
|
||||
pTq->pVnode->restored, (pTq->pStreamMeta->role == NODE_ROLE_LEADER));
|
||||
}
|
||||
|
||||
int32_t tqProcessTaskResetReq(STQ* pTq, SRpcMsg* pMsg) {
|
||||
return tqStreamTaskProcessTaskResetReq(pTq->pStreamMeta, pMsg->pCont);
|
||||
}
|
||||
|
||||
int32_t tqProcessAllTaskStopReq(STQ* pTq, SRpcMsg* pMsg) {
|
||||
return tqStreamTaskProcessAllTaskStopReq(pTq->pStreamMeta, &pTq->pVnode->msgCb, pMsg);
|
||||
}
|
||||
|
||||
int32_t tqProcessTaskRetrieveTriggerReq(STQ* pTq, SRpcMsg* pMsg) {
|
||||
int32_t vgId = TD_VID(pTq->pVnode);
|
||||
|
||||
|
|
|
@ -49,20 +49,6 @@ int32_t tqPushMsg(STQ* pTq, tmsg_t msgType) {
|
|||
}
|
||||
}
|
||||
|
||||
streamMetaRLock(pTq->pStreamMeta);
|
||||
int32_t numOfTasks = streamMetaGetNumOfTasks(pTq->pStreamMeta);
|
||||
streamMetaRUnLock(pTq->pStreamMeta);
|
||||
|
||||
// tqTrace("vgId:%d handle submit, restore:%d, numOfTasks:%d", TD_VID(pTq->pVnode), pTq->pVnode->restored, numOfTasks);
|
||||
|
||||
// push data for stream processing:
|
||||
// 1. the vnode has already been restored.
|
||||
// 2. the vnode should be the leader.
|
||||
// 3. the stream is not suspended yet.
|
||||
if ((!tsDisableStream) && (numOfTasks > 0)) {
|
||||
code = tqScanWalAsync(pTq, true);
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
|
@ -222,12 +222,12 @@ int32_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, uint64_t
|
|||
while (offset <= appliedVer) {
|
||||
if (walFetchHead(pHandle->pWalReader, offset) < 0) {
|
||||
tqDebug("tmq poll: consumer:0x%" PRIx64 ", (epoch %d) vgId:%d offset %" PRId64
|
||||
", no more log to return,QID:0x%" PRIx64 " 0x%" PRIx64,
|
||||
", no more log to return, QID:0x%" PRIx64 " 0x%" PRIx64,
|
||||
pHandle->consumerId, pHandle->epoch, vgId, offset, reqId, id);
|
||||
goto END;
|
||||
}
|
||||
|
||||
tqDebug("vgId:%d, consumer:0x%" PRIx64 " taosx get msg ver %" PRId64 ", type: %s,QID:0x%" PRIx64 " 0x%" PRIx64,
|
||||
tqDebug("vgId:%d, consumer:0x%" PRIx64 " taosx get msg ver %" PRId64 ", type:%s, QID:0x%" PRIx64 " 0x%" PRIx64,
|
||||
vgId, pHandle->consumerId, offset, TMSG_INFO(pHandle->pWalReader->pHead->head.msgType), reqId, id);
|
||||
|
||||
if (pHandle->pWalReader->pHead->head.msgType == TDMT_VND_SUBMIT) {
|
||||
|
|
|
@ -1428,6 +1428,7 @@ int32_t handleResultBlockMsg(SStreamTask* pTask, SSDataBlock* pDataBlock, int32_
|
|||
code = setDstTableDataUid(pVnode, pTask, pDataBlock, stbFullName, &tbData);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
tqError("vgId:%d s-task:%s dst-table not exist, stb:%s discard stream results", vgId, id, stbFullName);
|
||||
tDestroySubmitReq(&submitReq, TSDB_MSG_FLG_ENCODE);
|
||||
return code;
|
||||
}
|
||||
|
||||
|
@ -1439,12 +1440,14 @@ int32_t handleResultBlockMsg(SStreamTask* pTask, SSDataBlock* pDataBlock, int32_
|
|||
tbData.pCreateTbReq = NULL;
|
||||
}
|
||||
|
||||
tDestroySubmitReq(&submitReq, TSDB_MSG_FLG_ENCODE);
|
||||
return code;
|
||||
}
|
||||
|
||||
void* p = taosArrayPush(submitReq.aSubmitTbData, &tbData);
|
||||
if (p == NULL) {
|
||||
tqDebug("vgId:%d, s-task:%s failed to build submit msg, code:%s, data lost", vgId, id, tstrerror(terrno));
|
||||
tDestroySubmitReq(&submitReq, TSDB_MSG_FLG_ENCODE);
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,23 +16,19 @@
|
|||
#include "tq.h"
|
||||
#include "vnd.h"
|
||||
|
||||
#define MAX_REPEAT_SCAN_THRESHOLD 3
|
||||
#define SCAN_WAL_IDLE_DURATION 500 // idle for 500ms to do next wal scan
|
||||
#define SCAN_WAL_IDLE_DURATION 250 // idle for 500ms to do next wal scan
|
||||
#define SCAN_WAL_WAIT_COUNT 2
|
||||
|
||||
typedef struct SBuildScanWalMsgParam {
|
||||
int64_t metaId;
|
||||
int32_t numOfTasks;
|
||||
int8_t restored;
|
||||
SMsgCb msgCb;
|
||||
} SBuildScanWalMsgParam;
|
||||
|
||||
static int32_t doScanWalForAllTasks(SStreamMeta* pStreamMeta);
|
||||
static int32_t doScanWalForAllTasks(SStreamMeta* pStreamMeta, int32_t* pNumOfTasks);
|
||||
static int32_t setWalReaderStartOffset(SStreamTask* pTask, int32_t vgId);
|
||||
static bool handleFillhistoryScanComplete(SStreamTask* pTask, int64_t ver);
|
||||
static bool taskReadyForDataFromWal(SStreamTask* pTask);
|
||||
static int32_t doPutDataIntoInputQ(SStreamTask* pTask, int64_t maxVer, int32_t* numOfItems, bool* pSucc);
|
||||
static int32_t tqScanWalInFuture(STQ* pTq, int32_t numOfTasks, int32_t idleDuration);
|
||||
static int32_t doScanWalAsync(STQ* pTq, bool ckPause);
|
||||
|
||||
// extract data blocks(submit/delete) from WAL, and add them into the input queue for all the sources tasks.
|
||||
int32_t tqScanWal(STQ* pTq) {
|
||||
|
@ -40,46 +36,59 @@ int32_t tqScanWal(STQ* pTq) {
|
|||
int32_t vgId = pMeta->vgId;
|
||||
int64_t st = taosGetTimestampMs();
|
||||
int32_t numOfTasks = 0;
|
||||
int64_t el = 0;
|
||||
int32_t code = 0;
|
||||
|
||||
tqDebug("vgId:%d continue to check if data in wal are available, scanCounter:%d", vgId, pMeta->scanInfo.scanCounter);
|
||||
|
||||
// check all tasks
|
||||
int32_t code = doScanWalForAllTasks(pMeta);
|
||||
if (code) {
|
||||
tqError("vgId:%d failed to start all tasks, try next time, code:%s", vgId, tstrerror(code));
|
||||
int32_t old = atomic_val_compare_exchange_32(&pMeta->scanInfo.scanSentinel, 0, 1);
|
||||
if (old == 0) {
|
||||
tqDebug("vgId:%d try to scan wal to extract data", vgId);
|
||||
} else {
|
||||
tqDebug("vgId:%d already in wal scan, abort", vgId);
|
||||
return code;
|
||||
}
|
||||
|
||||
streamMetaWLock(pMeta);
|
||||
int32_t times = (--pMeta->scanInfo.scanCounter);
|
||||
if (times < 0) {
|
||||
tqError("vgId:%d invalid scan counter:%d, reset to 0", vgId, times);
|
||||
times = 0;
|
||||
// the scan wal interval less than 200, not scan, actually.
|
||||
if ((pMeta->scanInfo.lastScanTs > 0) && (st - pMeta->scanInfo.lastScanTs < 200)) {
|
||||
tqDebug("vgId:%d scan wal less than 200ms, do nothing", vgId);
|
||||
atomic_store_32(&pMeta->scanInfo.scanSentinel, 0);
|
||||
return code;
|
||||
}
|
||||
|
||||
numOfTasks = taosArrayGetSize(pMeta->pTaskList);
|
||||
streamMetaWUnLock(pMeta);
|
||||
// check all tasks
|
||||
code = doScanWalForAllTasks(pMeta, &numOfTasks);
|
||||
|
||||
int64_t el = (taosGetTimestampMs() - st);
|
||||
tqDebug("vgId:%d scan wal for stream tasks completed, elapsed time:%" PRId64 " ms", vgId, el);
|
||||
pMeta->scanInfo.lastScanTs = taosGetTimestampMs();
|
||||
el = (pMeta->scanInfo.lastScanTs - st);
|
||||
|
||||
if (times > 0) {
|
||||
tqDebug("vgId:%d scan wal for stream tasks for %d times in %dms", vgId, times, SCAN_WAL_IDLE_DURATION);
|
||||
code = tqScanWalInFuture(pTq, numOfTasks, SCAN_WAL_IDLE_DURATION);
|
||||
if (code) {
|
||||
tqError("vgId:%d sched scan wal in %dms failed, ignore this failure", vgId, SCAN_WAL_IDLE_DURATION);
|
||||
}
|
||||
if (code) {
|
||||
tqError("vgId:%d failed to scan wal for all tasks, try next time, elapsed time:%" PRId64 "ms code:%s", vgId, el,
|
||||
tstrerror(code));
|
||||
} else {
|
||||
tqDebug("vgId:%d scan wal for stream tasks completed, elapsed time:%" PRId64 "ms", vgId, el);
|
||||
}
|
||||
|
||||
atomic_store_32(&pMeta->scanInfo.scanSentinel, 0);
|
||||
return code;
|
||||
}
|
||||
|
||||
static void doStartScanWal(void* param, void* tmrId) {
|
||||
int32_t vgId = 0;
|
||||
int32_t code = 0;
|
||||
static bool waitEnoughDuration(SStreamMeta* pMeta) {
|
||||
if ((++pMeta->scanInfo.tickCounter) >= SCAN_WAL_WAIT_COUNT) {
|
||||
pMeta->scanInfo.tickCounter = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void doStartScanWal(void* param, void* tmrId) {
|
||||
int32_t vgId = 0;
|
||||
int32_t code = 0;
|
||||
int32_t numOfTasks = 0;
|
||||
tmr_h pTimer = NULL;
|
||||
SBuildScanWalMsgParam* pParam = (SBuildScanWalMsgParam*)param;
|
||||
|
||||
tqDebug("start to do scan wal in tmr, metaRid:%" PRId64, pParam->metaId);
|
||||
|
||||
SStreamMeta* pMeta = taosAcquireRef(streamMetaRefPool, pParam->metaId);
|
||||
if (pMeta == NULL) {
|
||||
tqError("metaRid:%" PRId64 " not valid now, stream meta has been freed", pParam->metaId);
|
||||
|
@ -87,10 +96,18 @@ static void doStartScanWal(void* param, void* tmrId) {
|
|||
return;
|
||||
}
|
||||
|
||||
vgId = pMeta->vgId;
|
||||
code = streamTimerGetInstance(&pTimer);
|
||||
if (code) {
|
||||
tqFatal("vgId:%d failed to get tmr ctrl during sched scan wal, not scan wal, code:%s", vgId, tstrerror(code));
|
||||
taosMemoryFree(pParam);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pMeta->closeFlag) {
|
||||
code = taosReleaseRef(streamMetaRefPool, pParam->metaId);
|
||||
if (code == TSDB_CODE_SUCCESS) {
|
||||
tqDebug("vgId:%d jump out of scan wal timer since closed", vgId);
|
||||
tqInfo("vgId:%d jump out of scan wal timer since closed", vgId);
|
||||
} else {
|
||||
tqError("vgId:%d failed to release ref for streamMeta, rid:%" PRId64 " code:%s", vgId, pParam->metaId,
|
||||
tstrerror(code));
|
||||
|
@ -100,77 +117,107 @@ static void doStartScanWal(void* param, void* tmrId) {
|
|||
return;
|
||||
}
|
||||
|
||||
vgId = pMeta->vgId;
|
||||
if (pMeta->role != NODE_ROLE_LEADER) {
|
||||
tqDebug("vgId:%d not leader, role:%d not scan wal anymore", vgId, pMeta->role);
|
||||
|
||||
tqDebug("vgId:%d create msg to start wal scan, numOfTasks:%d, vnd restored:%d", vgId, pParam->numOfTasks,
|
||||
pParam->restored);
|
||||
#if 0
|
||||
// wait for the vnode is freed, and invalid read may occur.
|
||||
code = taosReleaseRef(streamMetaRefPool, pParam->metaId);
|
||||
if (code == TSDB_CODE_SUCCESS) {
|
||||
tqDebug("vgId:%d jump out of scan wal timer since not leader", vgId);
|
||||
} else {
|
||||
tqError("vgId:%d failed to release ref for streamMeta, rid:%" PRId64 " code:%s", vgId, pParam->metaId,
|
||||
tstrerror(code));
|
||||
}
|
||||
|
||||
taosMemFree(pParam);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pMeta->startInfo.startAllTasks) {
|
||||
tqDebug("vgId:%d in restart procedure, not ready to scan wal", vgId);
|
||||
goto _end;
|
||||
}
|
||||
|
||||
if (!waitEnoughDuration(pMeta)) {
|
||||
streamTmrStart(doStartScanWal, SCAN_WAL_IDLE_DURATION, pParam, pTimer, &pMeta->scanInfo.scanTimer, vgId,
|
||||
"scan-wal");
|
||||
code = taosReleaseRef(streamMetaRefPool, pParam->metaId);
|
||||
if (code) {
|
||||
tqError("vgId:%d failed to release ref for streamMeta, rid:%" PRId64 " code:%s", vgId, pParam->metaId,
|
||||
tstrerror(code));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
code = streamMetaTryRlock(pMeta);
|
||||
if (code == 0) {
|
||||
numOfTasks = taosArrayGetSize(pMeta->pTaskList);
|
||||
streamMetaRUnLock(pMeta);
|
||||
} else {
|
||||
numOfTasks = 0;
|
||||
}
|
||||
|
||||
if (numOfTasks == 0) {
|
||||
goto _end;
|
||||
}
|
||||
|
||||
tqDebug("vgId:%d create msg to start wal scan, numOfTasks:%d", vgId, numOfTasks);
|
||||
|
||||
#if 0
|
||||
// wait for the vnode is freed, and invalid read may occur.
|
||||
taosMsleep(10000);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
code = streamTaskSchedTask(&pParam->msgCb, vgId, 0, 0, STREAM_EXEC_T_EXTRACT_WAL_DATA);
|
||||
if (code) {
|
||||
tqError("vgId:%d failed sched task to scan wal, code:%s", vgId, tstrerror(code));
|
||||
}
|
||||
|
||||
_end:
|
||||
streamTmrStart(doStartScanWal, SCAN_WAL_IDLE_DURATION, pParam, pTimer, &pMeta->scanInfo.scanTimer, vgId, "scan-wal");
|
||||
tqDebug("vgId:%d scan-wal will start in %dms", vgId, SCAN_WAL_IDLE_DURATION*SCAN_WAL_WAIT_COUNT);
|
||||
|
||||
code = taosReleaseRef(streamMetaRefPool, pParam->metaId);
|
||||
if (code) {
|
||||
tqError("vgId:%d failed to release ref for streamMeta, rid:%" PRId64 " code:%s", vgId, pParam->metaId,
|
||||
tstrerror(code));
|
||||
}
|
||||
|
||||
taosMemoryFree(pParam);
|
||||
}
|
||||
|
||||
int32_t tqScanWalInFuture(STQ* pTq, int32_t numOfTasks, int32_t idleDuration) {
|
||||
void tqScanWalAsync(STQ* pTq) {
|
||||
SStreamMeta* pMeta = pTq->pStreamMeta;
|
||||
int32_t code = 0;
|
||||
int32_t vgId = TD_VID(pTq->pVnode);
|
||||
tmr_h pTimer = NULL;
|
||||
SBuildScanWalMsgParam* pParam = NULL;
|
||||
|
||||
// 1. the vnode should be the leader.
|
||||
// 2. the stream isn't disabled
|
||||
if ((pMeta->role == NODE_ROLE_FOLLOWER) || tsDisableStream) {
|
||||
tqInfo("vgId:%d follower node or stream disabled, not scan wal", vgId);
|
||||
return;
|
||||
}
|
||||
|
||||
pParam = taosMemoryMalloc(sizeof(SBuildScanWalMsgParam));
|
||||
if (pParam == NULL) {
|
||||
return terrno;
|
||||
tqError("vgId:%d failed to start scan wal, stream not executes, code:%s", vgId, tstrerror(code));
|
||||
return;
|
||||
}
|
||||
|
||||
pParam->metaId = pMeta->rid;
|
||||
pParam->numOfTasks = numOfTasks;
|
||||
pParam->restored = pTq->pVnode->restored;
|
||||
pParam->msgCb = pTq->pVnode->msgCb;
|
||||
|
||||
code = streamTimerGetInstance(&pTimer);
|
||||
if (code) {
|
||||
tqError("vgId:%d failed to get tmr ctrl during sched scan wal", vgId);
|
||||
tqFatal("vgId:%d failed to get tmr ctrl during sched scan wal", vgId);
|
||||
taosMemoryFree(pParam);
|
||||
} else {
|
||||
streamTmrStart(doStartScanWal, idleDuration, pParam, pTimer, &pMeta->scanInfo.scanTimer, vgId, "scan-wal-fut");
|
||||
streamTmrStart(doStartScanWal, SCAN_WAL_IDLE_DURATION, pParam, pTimer, &pMeta->scanInfo.scanTimer, vgId,
|
||||
"scan-wal");
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
int32_t tqScanWalAsync(STQ* pTq, bool ckPause) {
|
||||
SStreamMeta* pMeta = pTq->pStreamMeta;
|
||||
bool alreadyRestored = pTq->pVnode->restored;
|
||||
int32_t code = 0;
|
||||
|
||||
// do not launch the stream tasks, if it is a follower or not restored vnode.
|
||||
if (!(vnodeIsRoleLeader(pTq->pVnode) && alreadyRestored)) {
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
streamMetaWLock(pMeta);
|
||||
code = doScanWalAsync(pTq, ckPause);
|
||||
streamMetaWUnLock(pMeta);
|
||||
return code;
|
||||
}
|
||||
|
||||
int32_t tqStopStreamTasksAsync(STQ* pTq) {
|
||||
SStreamMeta* pMeta = pTq->pStreamMeta;
|
||||
int32_t vgId = pMeta->vgId;
|
||||
return streamTaskSchedTask(&pTq->pVnode->msgCb, vgId, 0, 0, STREAM_EXEC_T_STOP_ALL_TASKS);
|
||||
int32_t tqStopStreamAllTasksAsync(SStreamMeta* pMeta, SMsgCb* pMsgCb) {
|
||||
return streamTaskSchedTask(pMsgCb, pMeta->vgId, 0, 0, STREAM_EXEC_T_STOP_ALL_TASKS);
|
||||
}
|
||||
|
||||
int32_t setWalReaderStartOffset(SStreamTask* pTask, int32_t vgId) {
|
||||
|
@ -273,9 +320,13 @@ bool taskReadyForDataFromWal(SStreamTask* pTask) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// check if input queue is full or not
|
||||
// check whether input queue is full or not
|
||||
if (streamQueueIsFull(pTask->inputq.queue)) {
|
||||
tqTrace("s-task:%s input queue is full, do nothing", pTask->id.idStr);
|
||||
tqTrace("s-task:%s input queue is full, launch task without scanning wal", pTask->id.idStr);
|
||||
int32_t code = streamTrySchedExec(pTask);
|
||||
if (code) {
|
||||
tqError("s-task:%s failed to start task while inputQ is full", pTask->id.idStr);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -347,13 +398,10 @@ int32_t doPutDataIntoInputQ(SStreamTask* pTask, int64_t maxVer, int32_t* numOfIt
|
|||
return code;
|
||||
}
|
||||
|
||||
int32_t doScanWalForAllTasks(SStreamMeta* pStreamMeta) {
|
||||
int32_t doScanWalForAllTasks(SStreamMeta* pStreamMeta, int32_t* pNumOfTasks) {
|
||||
int32_t vgId = pStreamMeta->vgId;
|
||||
SArray* pTaskList = NULL;
|
||||
int32_t numOfTasks = taosArrayGetSize(pStreamMeta->pTaskList);
|
||||
if (numOfTasks == 0) {
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
int32_t numOfTasks = 0;
|
||||
|
||||
// clone the task list, to avoid the task update during scan wal files
|
||||
streamMetaWLock(pStreamMeta);
|
||||
|
@ -364,10 +412,13 @@ int32_t doScanWalForAllTasks(SStreamMeta* pStreamMeta) {
|
|||
return terrno;
|
||||
}
|
||||
|
||||
tqDebug("vgId:%d start to check wal to extract new submit block for %d tasks", vgId, numOfTasks);
|
||||
|
||||
// update the new task number
|
||||
numOfTasks = taosArrayGetSize(pTaskList);
|
||||
if (pNumOfTasks != NULL) {
|
||||
*pNumOfTasks = numOfTasks;
|
||||
}
|
||||
|
||||
tqDebug("vgId:%d start to check wal to extract new submit block for %d tasks", vgId, numOfTasks);
|
||||
|
||||
for (int32_t i = 0; i < numOfTasks; ++i) {
|
||||
STaskId* pTaskId = taosArrayGet(pTaskList, i);
|
||||
|
@ -426,51 +477,9 @@ int32_t doScanWalForAllTasks(SStreamMeta* pStreamMeta) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t doScanWalAsync(STQ* pTq, bool ckPause) {
|
||||
SStreamMeta* pMeta = pTq->pStreamMeta;
|
||||
bool alreadyRestored = pTq->pVnode->restored;
|
||||
int32_t vgId = pMeta->vgId;
|
||||
int32_t numOfTasks = taosArrayGetSize(pMeta->pTaskList);
|
||||
|
||||
if (numOfTasks == 0) {
|
||||
tqDebug("vgId:%d no stream tasks existed to run", vgId);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pMeta->startInfo.startAllTasks) {
|
||||
tqTrace("vgId:%d in restart procedure, not scan wal", vgId);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pMeta->scanInfo.scanCounter += 1;
|
||||
if (pMeta->scanInfo.scanCounter > MAX_REPEAT_SCAN_THRESHOLD) {
|
||||
pMeta->scanInfo.scanCounter = MAX_REPEAT_SCAN_THRESHOLD;
|
||||
}
|
||||
|
||||
if (pMeta->scanInfo.scanCounter > 1) {
|
||||
tqDebug("vgId:%d wal read task has been launched, remain scan times:%d", vgId, pMeta->scanInfo.scanCounter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t numOfPauseTasks = pMeta->numOfPausedTasks;
|
||||
if (ckPause && numOfTasks == numOfPauseTasks) {
|
||||
tqDebug("vgId:%d ignore all submit, all streams had been paused, reset the walScanCounter", vgId);
|
||||
|
||||
// reset the counter value, since we do not launch the scan wal operation.
|
||||
pMeta->scanInfo.scanCounter = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
tqDebug("vgId:%d create msg to start wal scan to launch stream tasks, numOfTasks:%d, vnd restored:%d", vgId,
|
||||
numOfTasks, alreadyRestored);
|
||||
|
||||
return streamTaskSchedTask(&pTq->pVnode->msgCb, vgId, 0, 0, STREAM_EXEC_T_EXTRACT_WAL_DATA);
|
||||
}
|
||||
|
||||
void streamMetaFreeTQDuringScanWalError(STQ* pTq) {
|
||||
SBuildScanWalMsgParam* p = taosMemoryCalloc(1, sizeof(SBuildScanWalMsgParam));
|
||||
p->metaId = pTq->pStreamMeta->rid;
|
||||
p->numOfTasks = 0;
|
||||
|
||||
doStartScanWal(p, 0);
|
||||
}
|
|
@ -47,6 +47,10 @@ END:
|
|||
void tqUpdateNodeStage(STQ* pTq, bool isLeader) {
|
||||
SSyncState state = syncGetState(pTq->pVnode->sync);
|
||||
streamMetaUpdateStageRole(pTq->pStreamMeta, state.term, isLeader);
|
||||
|
||||
if (isLeader) {
|
||||
tqScanWalAsync(pTq);
|
||||
}
|
||||
}
|
||||
|
||||
static int32_t tqInitTaosxRsp(SMqDataRsp* pRsp, STqOffsetVal pOffset) {
|
||||
|
@ -190,10 +194,10 @@ end:
|
|||
char buf[TSDB_OFFSET_LEN] = {0};
|
||||
tFormatOffset(buf, TSDB_OFFSET_LEN, &dataRsp.rspOffset);
|
||||
if (code != 0){
|
||||
tqError("tmq poll: consumer:0x%" PRIx64 ", subkey %s, vgId:%d, rsp block:%d, rsp offset type:%s,QID:0x%" PRIx64 " error msg:%s, line:%d",
|
||||
tqError("tmq poll: consumer:0x%" PRIx64 ", subkey %s, vgId:%d, rsp block:%d, rsp offset type:%s, QID:0x%" PRIx64 " error msg:%s, line:%d",
|
||||
consumerId, pHandle->subKey, vgId, dataRsp.blockNum, buf, pRequest->reqId, tstrerror(code), lino);
|
||||
} else {
|
||||
tqDebug("tmq poll: consumer:0x%" PRIx64 ", subkey %s, vgId:%d, rsp block:%d, rsp offset type:%s,QID:0x%" PRIx64 " success",
|
||||
tqDebug("tmq poll: consumer:0x%" PRIx64 ", subkey %s, vgId:%d, rsp block:%d, rsp offset type:%s, QID:0x%" PRIx64 " success",
|
||||
consumerId, pHandle->subKey, vgId, dataRsp.blockNum, buf, pRequest->reqId);
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ int32_t tqStreamStartOneTaskAsync(SStreamMeta* pMeta, SMsgCb* cb, int64_t stream
|
|||
}
|
||||
|
||||
// this is to process request from transaction, always return true.
|
||||
int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pMsg, bool restored) {
|
||||
int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pMsg, bool restored, bool isLeader) {
|
||||
int32_t vgId = pMeta->vgId;
|
||||
char* msg = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead));
|
||||
int32_t len = pMsg->contLen - sizeof(SMsgHead);
|
||||
|
@ -268,13 +268,13 @@ int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pM
|
|||
// stream do update the nodeEp info, write it into stream meta.
|
||||
if (updated) {
|
||||
tqDebug("s-task:%s vgId:%d save task after update epset, and stop task", idstr, vgId);
|
||||
code = streamMetaSaveTask(pMeta, pTask);
|
||||
code = streamMetaSaveTaskInMeta(pMeta, pTask);
|
||||
if (code) {
|
||||
tqError("s-task:%s vgId:%d failed to save task, code:%s", idstr, vgId, tstrerror(code));
|
||||
}
|
||||
|
||||
if (pHTask != NULL) {
|
||||
code = streamMetaSaveTask(pMeta, pHTask);
|
||||
code = streamMetaSaveTaskInMeta(pMeta, pHTask);
|
||||
if (code) {
|
||||
tqError("s-task:%s vgId:%d failed to save related history task, code:%s", idstr, vgId, tstrerror(code));
|
||||
}
|
||||
|
@ -306,14 +306,19 @@ int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pM
|
|||
int32_t numOfTasks = streamMetaGetNumOfTasks(pMeta);
|
||||
int32_t updateTasks = taosHashGetSize(pMeta->updateInfo.pTasks);
|
||||
|
||||
if (restored) {
|
||||
if (restored && isLeader) {
|
||||
tqDebug("vgId:%d s-task:0x%x update epset transId:%d, set the restart flag", vgId, req.taskId, req.transId);
|
||||
pMeta->startInfo.tasksWillRestart = 1;
|
||||
}
|
||||
|
||||
if (updateTasks < numOfTasks) {
|
||||
tqDebug("vgId:%d closed tasks:%d, unclosed:%d, all tasks will be started when nodeEp update completed", vgId,
|
||||
updateTasks, (numOfTasks - updateTasks));
|
||||
if (isLeader) {
|
||||
tqDebug("vgId:%d closed tasks:%d, unclosed:%d, all tasks will be started when nodeEp update completed", vgId,
|
||||
updateTasks, (numOfTasks - updateTasks));
|
||||
} else {
|
||||
tqDebug("vgId:%d closed tasks:%d, unclosed:%d, follower not restart tasks", vgId, updateTasks,
|
||||
(numOfTasks - updateTasks));
|
||||
}
|
||||
} else {
|
||||
if ((code = streamMetaCommit(pMeta)) < 0) {
|
||||
// always return true
|
||||
|
@ -324,17 +329,21 @@ int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pM
|
|||
|
||||
streamMetaClearSetUpdateTaskListComplete(pMeta);
|
||||
|
||||
if (!restored) {
|
||||
tqDebug("vgId:%d vnode restore not completed, not start all tasks", vgId);
|
||||
} else {
|
||||
tqDebug("vgId:%d all %d task(s) nodeEp updated and closed, transId:%d", vgId, numOfTasks, req.transId);
|
||||
if (isLeader) {
|
||||
if (!restored) {
|
||||
tqDebug("vgId:%d vnode restore not completed, not start all tasks", vgId);
|
||||
} else {
|
||||
tqDebug("vgId:%d all %d task(s) nodeEp updated and closed, transId:%d", vgId, numOfTasks, req.transId);
|
||||
#if 0
|
||||
taosMSleep(5000);// for test purpose, to trigger the leader election
|
||||
#endif
|
||||
code = tqStreamTaskStartAsync(pMeta, cb, true);
|
||||
if (code) {
|
||||
tqError("vgId:%d async start all tasks, failed, code:%s", vgId, tstrerror(code));
|
||||
code = tqStreamTaskStartAsync(pMeta, cb, true);
|
||||
if (code) {
|
||||
tqError("vgId:%d async start all tasks, failed, code:%s", vgId, tstrerror(code));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tqDebug("vgId:%d follower nodes not restart tasks", vgId);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -461,7 +470,7 @@ int32_t tqStreamTaskProcessRetrieveReq(SStreamMeta* pMeta, SRpcMsg* pMsg) {
|
|||
}
|
||||
|
||||
// enqueue
|
||||
tqDebug("s-task:%s (vgId:%d level:%d) recv retrieve req from task:0x%x(vgId:%d),QID:0x%" PRIx64, pTask->id.idStr,
|
||||
tqDebug("s-task:%s (vgId:%d level:%d) recv retrieve req from task:0x%x(vgId:%d), QID:0x%" PRIx64, pTask->id.idStr,
|
||||
pTask->pMeta->vgId, pTask->info.taskLevel, req.srcTaskId, req.srcNodeId, req.reqId);
|
||||
|
||||
// if task is in ck status, set current ck failed
|
||||
|
@ -751,6 +760,8 @@ int32_t tqStreamTaskProcessDropReq(SStreamMeta* pMeta, char* msg, int32_t msgLen
|
|||
}
|
||||
|
||||
streamMetaWUnLock(pMeta);
|
||||
tqDebug("vgId:%d process drop task:0x%x completed", vgId, pReq->taskId);
|
||||
|
||||
return 0; // always return success
|
||||
}
|
||||
|
||||
|
@ -865,6 +876,9 @@ int32_t tqStreamTaskProcessRunReq(SStreamMeta* pMeta, SRpcMsg* pMsg, bool isLead
|
|||
} else if (type == STREAM_EXEC_T_ADD_FAILED_TASK) {
|
||||
code = streamMetaAddFailedTask(pMeta, req.streamId, req.taskId);
|
||||
return code;
|
||||
} else if (type == STREAM_EXEC_T_STOP_ONE_TASK) {
|
||||
code = streamMetaStopOneTask(pMeta, req.streamId, req.taskId);
|
||||
return code;
|
||||
} else if (type == STREAM_EXEC_T_RESUME_TASK) { // task resume to run after idle for a while
|
||||
SStreamTask* pTask = NULL;
|
||||
code = streamMetaAcquireTask(pMeta, req.streamId, req.taskId, &pTask);
|
||||
|
@ -946,10 +960,10 @@ int32_t tqStartTaskCompleteCallback(SStreamMeta* pMeta) {
|
|||
|
||||
streamMetaWUnLock(pMeta);
|
||||
|
||||
if (scanWal && (vgId != SNODE_HANDLE)) {
|
||||
tqDebug("vgId:%d start scan wal for executing tasks", vgId);
|
||||
code = tqScanWalAsync(pMeta->ahandle, true);
|
||||
}
|
||||
// if (scanWal && (vgId != SNODE_HANDLE)) {
|
||||
// tqDebug("vgId:%d start scan wal for executing tasks", vgId);
|
||||
// code = tqScanWalAsync(pMeta->ahandle, true);
|
||||
// }
|
||||
|
||||
return code;
|
||||
}
|
||||
|
@ -991,6 +1005,39 @@ int32_t tqStreamTaskProcessTaskResetReq(SStreamMeta* pMeta, char* pMsg) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t tqStreamTaskProcessAllTaskStopReq(SStreamMeta* pMeta, SMsgCb* pMsgCb, SRpcMsg* pMsg) {
|
||||
int32_t code = 0;
|
||||
int32_t vgId = pMeta->vgId;
|
||||
char* msg = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead));
|
||||
int32_t len = pMsg->contLen - sizeof(SMsgHead);
|
||||
SDecoder decoder;
|
||||
|
||||
SStreamTaskStopReq req = {0};
|
||||
tDecoderInit(&decoder, (uint8_t*)msg, len);
|
||||
if ((code = tDecodeStreamTaskStopReq(&decoder, &req)) < 0) {
|
||||
tqError("vgId:%d failed to decode stop all streams, code:%s", pMeta->vgId, tstrerror(code));
|
||||
tDecoderClear(&decoder);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
tDecoderClear(&decoder);
|
||||
|
||||
// stop all stream tasks, only invoked when trying to drop db
|
||||
if (req.streamId <= 0) {
|
||||
tqDebug("vgId:%d recv msg to stop all tasks in sync before dropping vnode", vgId);
|
||||
code = streamMetaStopAllTasks(pMeta);
|
||||
if (code) {
|
||||
tqError("vgId:%d failed to stop all tasks, code:%s", vgId, tstrerror(code));
|
||||
}
|
||||
|
||||
} else { // stop only one stream tasks
|
||||
|
||||
}
|
||||
|
||||
// always return success
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t tqStreamTaskProcessRetrieveTriggerReq(SStreamMeta* pMeta, SRpcMsg* pMsg) {
|
||||
SRetrieveChkptTriggerReq req = {0};
|
||||
SStreamTask* pTask = NULL;
|
||||
|
@ -1178,7 +1225,7 @@ static int32_t tqProcessTaskResumeImpl(void* handle, SStreamTask* pTask, int64_t
|
|||
pTask->hTaskInfo.operatorOpen = false;
|
||||
code = streamStartScanHistoryAsync(pTask, igUntreated);
|
||||
} else if (level == TASK_LEVEL__SOURCE && (streamQueueGetNumOfItems(pTask->inputq.queue) == 0)) {
|
||||
code = tqScanWalAsync((STQ*)handle, false);
|
||||
// code = tqScanWalAsync((STQ*)handle, false);
|
||||
} else {
|
||||
code = streamTrySchedExec(pTask);
|
||||
}
|
||||
|
|
|
@ -249,14 +249,14 @@ int32_t tsdbTFileObjRef(STFileObj *fobj) {
|
|||
(void)taosThreadMutexLock(&fobj->mutex);
|
||||
|
||||
if (fobj->ref <= 0 || fobj->state != TSDB_FSTATE_LIVE) {
|
||||
tsdbError("file %s, fobj:%p ref %d", fobj->fname, fobj, fobj->ref);
|
||||
tsdbError("file %s, fobj:%p ref:%d", fobj->fname, fobj, fobj->ref);
|
||||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
return TSDB_CODE_FAILED;
|
||||
}
|
||||
|
||||
nRef = ++fobj->ref;
|
||||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
tsdbTrace("ref file %s, fobj:%p ref %d", fobj->fname, fobj, nRef);
|
||||
tsdbTrace("ref file %s, fobj:%p ref:%d", fobj->fname, fobj, nRef);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -266,11 +266,11 @@ int32_t tsdbTFileObjUnref(STFileObj *fobj) {
|
|||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
|
||||
if (nRef < 0) {
|
||||
tsdbError("file %s, fobj:%p ref %d", fobj->fname, fobj, nRef);
|
||||
tsdbError("file %s, fobj:%p ref:%d", fobj->fname, fobj, nRef);
|
||||
return TSDB_CODE_FAILED;
|
||||
}
|
||||
|
||||
tsdbTrace("unref file %s, fobj:%p ref %d", fobj->fname, fobj, nRef);
|
||||
tsdbTrace("unref file %s, fobj:%p ref:%d", fobj->fname, fobj, nRef);
|
||||
if (nRef == 0) {
|
||||
if (fobj->state == TSDB_FSTATE_DEAD) {
|
||||
tsdbRemoveFile(fobj->fname);
|
||||
|
@ -335,14 +335,14 @@ static void tsdbTFileObjRemoveLC(STFileObj *fobj, bool remove_all) {
|
|||
int32_t tsdbTFileObjRemove(STFileObj *fobj) {
|
||||
(void)taosThreadMutexLock(&fobj->mutex);
|
||||
if (fobj->state != TSDB_FSTATE_LIVE || fobj->ref <= 0) {
|
||||
tsdbError("file %s, fobj:%p ref %d", fobj->fname, fobj, fobj->ref);
|
||||
tsdbError("file %s, fobj:%p ref:%d", fobj->fname, fobj, fobj->ref);
|
||||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
return TSDB_CODE_FAILED;
|
||||
}
|
||||
fobj->state = TSDB_FSTATE_DEAD;
|
||||
int32_t nRef = --fobj->ref;
|
||||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
tsdbTrace("remove unref file %s, fobj:%p ref %d", fobj->fname, fobj, nRef);
|
||||
tsdbTrace("remove unref file %s, fobj:%p ref:%d", fobj->fname, fobj, nRef);
|
||||
if (nRef == 0) {
|
||||
tsdbTFileObjRemoveLC(fobj, true);
|
||||
taosMemoryFree(fobj);
|
||||
|
@ -355,14 +355,14 @@ int32_t tsdbTFileObjRemoveUpdateLC(STFileObj *fobj) {
|
|||
|
||||
if (fobj->state != TSDB_FSTATE_LIVE || fobj->ref <= 0) {
|
||||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
tsdbError("file %s, fobj:%p ref %d", fobj->fname, fobj, fobj->ref);
|
||||
tsdbError("file %s, fobj:%p ref:%d", fobj->fname, fobj, fobj->ref);
|
||||
return TSDB_CODE_FAILED;
|
||||
}
|
||||
|
||||
fobj->state = TSDB_FSTATE_DEAD;
|
||||
int32_t nRef = --fobj->ref;
|
||||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
tsdbTrace("remove unref file %s, fobj:%p ref %d", fobj->fname, fobj, nRef);
|
||||
tsdbTrace("remove unref file %s, fobj:%p ref:%d", fobj->fname, fobj, nRef);
|
||||
if (nRef == 0) {
|
||||
tsdbTFileObjRemoveLC(fobj, false);
|
||||
taosMemoryFree(fobj);
|
||||
|
|
|
@ -230,7 +230,7 @@ static int32_t setColumnIdSlotList(SBlockLoadSuppInfo* pSupInfo, SColumnInfo* pC
|
|||
if (IS_VAR_DATA_TYPE(pCols[i].type)) {
|
||||
pSupInfo->buildBuf[i] = taosMemoryMalloc(pCols[i].bytes);
|
||||
if (pSupInfo->buildBuf[i] == NULL) {
|
||||
tsdbError("failed to prepare memory for set columnId slot list, size:%d, code: %s", pCols[i].bytes,
|
||||
tsdbError("failed to prepare memory for set columnId slot list, size:%d, code:%s", pCols[i].bytes,
|
||||
tstrerror(terrno));
|
||||
}
|
||||
TSDB_CHECK_NULL(pSupInfo->buildBuf[i], code, lino, _end, terrno);
|
||||
|
|
|
@ -750,6 +750,12 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t ver, SRpcMsg
|
|||
goto _err;
|
||||
}
|
||||
|
||||
} break;
|
||||
case TDMT_VND_STREAM_ALL_STOP: {
|
||||
if (pVnode->restored && vnodeIsLeader(pVnode) && (code = tqProcessAllTaskStopReq(pVnode->pTq, pMsg)) < 0) {
|
||||
goto _err;
|
||||
}
|
||||
|
||||
} break;
|
||||
case TDMT_VND_ALTER_CONFIRM:
|
||||
needCommit = pVnode->config.hashChange;
|
||||
|
@ -948,8 +954,6 @@ int32_t vnodeProcessStreamMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo)
|
|||
return tqProcessTaskRetrieveReq(pVnode->pTq, pMsg);
|
||||
case TDMT_STREAM_RETRIEVE_RSP:
|
||||
return tqProcessTaskRetrieveRsp(pVnode->pTq, pMsg);
|
||||
case TDMT_VND_STREAM_SCAN_HISTORY:
|
||||
return tqProcessTaskScanHistory(pVnode->pTq, pMsg);
|
||||
case TDMT_VND_GET_STREAM_PROGRESS:
|
||||
return tqStreamProgressRetrieveReq(pVnode->pTq, pMsg);
|
||||
default:
|
||||
|
@ -996,6 +1000,22 @@ int32_t vnodeProcessStreamCtrlMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pIn
|
|||
}
|
||||
}
|
||||
|
||||
int32_t vnodeProcessStreamLongExecMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) {
|
||||
vTrace("vgId:%d, msg:%p in stream long exec queue is processing", pVnode->config.vgId, pMsg);
|
||||
if (!syncIsReadyForRead(pVnode->sync)) {
|
||||
vnodeRedirectRpcMsg(pVnode, pMsg, terrno);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (pMsg->msgType) {
|
||||
case TDMT_VND_STREAM_SCAN_HISTORY:
|
||||
return tqProcessTaskScanHistory(pVnode->pTq, pMsg);
|
||||
default:
|
||||
vError("unknown msg type:%d in stream long exec queue", pMsg->msgType);
|
||||
return TSDB_CODE_APP_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
void smaHandleRes(void *pVnode, int64_t smaId, const SArray *data) {
|
||||
int32_t code = tdProcessTSmaInsert(((SVnode *)pVnode)->pSma, smaId, (const char *)data);
|
||||
if (code) {
|
||||
|
|
|
@ -624,7 +624,7 @@ static void vnodeBecomeFollower(const SSyncFSM *pFsm) {
|
|||
|
||||
if (pVnode->pTq) {
|
||||
tqUpdateNodeStage(pVnode->pTq, false);
|
||||
if (tqStopStreamTasksAsync(pVnode->pTq) != 0) {
|
||||
if (tqStopStreamAllTasksAsync(pVnode->pTq->pStreamMeta, &pVnode->msgCb) != 0) {
|
||||
vError("vgId:%d, failed to stop stream tasks", pVnode->config.vgId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,12 +27,12 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
// clang-format off
|
||||
#define azFatal(...) { if (azDebugFlag & DEBUG_FATAL) { taosPrintLog("AZR FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }}
|
||||
#define azError(...) { if (azDebugFlag & DEBUG_ERROR) { taosPrintLog("AZR ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }}
|
||||
#define azWarn(...) { if (azDebugFlag & DEBUG_WARN) { taosPrintLog("AZR WARN ", DEBUG_WARN, 255, __VA_ARGS__); }}
|
||||
#define azInfo(...) { if (azDebugFlag & DEBUG_INFO) { taosPrintLog("AZR ", DEBUG_INFO, 255, __VA_ARGS__); }}
|
||||
#define azDebug(...) { if (azDebugFlag & DEBUG_DEBUG) { taosPrintLog("AZR ", DEBUG_DEBUG, azDebugFlag, __VA_ARGS__); }}
|
||||
#define azTrace(...) { if (azDebugFlag & DEBUG_TRACE) { taosPrintLog("AZR ", DEBUG_TRACE, azDebugFlag, __VA_ARGS__); }}
|
||||
#define azFatal(...) { if (azDebugFlag & DEBUG_FATAL) { taosPrintLog("AZR FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }}
|
||||
#define azError(...) { if (azDebugFlag & DEBUG_ERROR) { taosPrintLog("AZR ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }}
|
||||
#define azWarn(...) { if (azDebugFlag & DEBUG_WARN) { taosPrintLog("AZR WARN ", DEBUG_WARN, 255, __VA_ARGS__); }}
|
||||
#define azInfo(...) { if (azDebugFlag & DEBUG_INFO) { taosPrintLog("AZR INFO ", DEBUG_INFO, 255, __VA_ARGS__); }}
|
||||
#define azDebug(...) { if (azDebugFlag & DEBUG_DEBUG) { taosPrintLog("AZR DEBUG ", DEBUG_DEBUG, azDebugFlag, __VA_ARGS__); }}
|
||||
#define azTrace(...) { if (azDebugFlag & DEBUG_TRACE) { taosPrintLog("AZR TRACE ", DEBUG_TRACE, azDebugFlag, __VA_ARGS__); }}
|
||||
// clang-format on
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -827,19 +827,19 @@ typedef struct SCtgCacheItemInfo {
|
|||
#define CTG_CACHE_OVERFLOW(_csize, _maxsize) ((_maxsize >= 0) ? ((_csize) >= (_maxsize)*1048576L * 0.9) : false)
|
||||
#define CTG_CACHE_LOW(_csize, _maxsize) ((_maxsize >= 0) ? ((_csize) <= (_maxsize)*1048576L * 0.75) : true)
|
||||
|
||||
#define ctgFatal(param, ...) qFatal("CTG:%p " param, pCtg, __VA_ARGS__)
|
||||
#define ctgError(param, ...) qError("CTG:%p " param, pCtg, __VA_ARGS__)
|
||||
#define ctgWarn(param, ...) qWarn("CTG:%p " param, pCtg, __VA_ARGS__)
|
||||
#define ctgInfo(param, ...) qInfo("CTG:%p " param, pCtg, __VA_ARGS__)
|
||||
#define ctgDebug(param, ...) qDebug("CTG:%p " param, pCtg, __VA_ARGS__)
|
||||
#define ctgTrace(param, ...) qTrace("CTG:%p " param, pCtg, __VA_ARGS__)
|
||||
#define ctgFatal(param, ...) qFatal("CTG:%p, " param, pCtg, __VA_ARGS__)
|
||||
#define ctgError(param, ...) qError("CTG:%p, " param, pCtg, __VA_ARGS__)
|
||||
#define ctgWarn(param, ...) qWarn ("CTG:%p, " param, pCtg, __VA_ARGS__)
|
||||
#define ctgInfo(param, ...) qInfo ("CTG:%p, " param, pCtg, __VA_ARGS__)
|
||||
#define ctgDebug(param, ...) qDebug("CTG:%p, " param, pCtg, __VA_ARGS__)
|
||||
#define ctgTrace(param, ...) qTrace("CTG:%p, " param, pCtg, __VA_ARGS__)
|
||||
|
||||
#define ctgTaskFatal(param, ...) qFatal("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
|
||||
#define ctgTaskError(param, ...) qError("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
|
||||
#define ctgTaskWarn(param, ...) qWarn("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
|
||||
#define ctgTaskInfo(param, ...) qInfo("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
|
||||
#define ctgTaskDebug(param, ...) qDebug("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
|
||||
#define ctgTaskTrace(param, ...) qTrace("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
|
||||
#define ctgTaskFatal(param, ...) qFatal("QID:%" PRIx64 ", CTG:%p, " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
|
||||
#define ctgTaskError(param, ...) qError("QID:%" PRIx64 ", CTG:%p, " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
|
||||
#define ctgTaskWarn(param, ...) qWarn ("QID:%" PRIx64 ", CTG:%p, " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
|
||||
#define ctgTaskInfo(param, ...) qInfo ("QID:%" PRIx64 ", CTG:%p, " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
|
||||
#define ctgTaskDebug(param, ...) qDebug("QID:%" PRIx64 ", CTG:%p, " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
|
||||
#define ctgTaskTrace(param, ...) qTrace("QID:%" PRIx64 ", CTG:%p, " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
|
||||
|
||||
#define CTG_LOCK_DEBUG(...) \
|
||||
do { \
|
||||
|
|
|
@ -85,7 +85,7 @@ int32_t ctgRefreshDBVgInfo(SCatalog* pCtg, SRequestConnInfo* pConn, const char*
|
|||
code = ctgGetDBVgInfoFromMnode(pCtg, pConn, &input, &DbOut, NULL);
|
||||
if (code) {
|
||||
if (CTG_DB_NOT_EXIST(code) && (NULL != dbCache)) {
|
||||
ctgDebug("db no longer exist, dbFName:%s, dbId:0x%" PRIx64, input.db, input.dbId);
|
||||
ctgDebug("db:%s, db no longer exist, dbId:0x%" PRIx64, input.db, input.dbId);
|
||||
CTG_ERR_RET(ctgDropDbCacheEnqueue(pCtg, input.db, input.dbId));
|
||||
}
|
||||
|
||||
|
@ -114,11 +114,11 @@ int32_t ctgRefreshTbMeta(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgTbMetaCtx*
|
|||
}
|
||||
|
||||
if (CTG_FLAG_IS_SYS_DB(ctx->flag)) {
|
||||
ctgDebug("will refresh tbmeta, supposed in information_schema, tbName:%s", tNameGetTableName(ctx->pName));
|
||||
ctgDebug("tb:%s, will refresh tbmeta, supposed in information_schema", tNameGetTableName(ctx->pName));
|
||||
|
||||
CTG_ERR_JRET(ctgGetTbMetaFromMnodeImpl(pCtg, pConn, (char*)ctx->pName->dbname, (char*)ctx->pName->tname, output, NULL));
|
||||
} else if (CTG_FLAG_IS_STB(ctx->flag)) {
|
||||
ctgDebug("will refresh tbmeta, supposed to be stb, tbName:%s", tNameGetTableName(ctx->pName));
|
||||
ctgDebug("tb:%s, will refresh tbmeta, supposed to be stb", tNameGetTableName(ctx->pName));
|
||||
|
||||
// if get from mnode failed, will not try vnode
|
||||
CTG_ERR_JRET(ctgGetTbMetaFromMnode(pCtg, pConn, ctx->pName, output, NULL));
|
||||
|
@ -127,13 +127,13 @@ int32_t ctgRefreshTbMeta(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgTbMetaCtx*
|
|||
CTG_ERR_JRET(ctgGetTbMetaFromVnode(pCtg, pConn, ctx->pName, &vgroupInfo, output, NULL));
|
||||
}
|
||||
} else {
|
||||
ctgDebug("will refresh tbmeta, not supposed to be stb, tbName:%s, flag:%d", tNameGetTableName(ctx->pName), ctx->flag);
|
||||
ctgDebug("tb:%s, will refresh tbmeta, not supposed to be stb, flag:%d", tNameGetTableName(ctx->pName), ctx->flag);
|
||||
|
||||
// if get from vnode failed or no table meta, will not try mnode
|
||||
CTG_ERR_JRET(ctgGetTbMetaFromVnode(pCtg, pConn, ctx->pName, &vgroupInfo, output, NULL));
|
||||
|
||||
if (CTG_IS_META_TABLE(output->metaType) && TSDB_SUPER_TABLE == output->tbMeta->tableType) {
|
||||
ctgDebug("will continue to refresh tbmeta since got stb, tbName:%s", tNameGetTableName(ctx->pName));
|
||||
ctgDebug("tb:%s, will continue to refresh tbmeta since got stb", tNameGetTableName(ctx->pName));
|
||||
|
||||
taosMemoryFreeClear(output->tbMeta);
|
||||
|
||||
|
@ -163,16 +163,15 @@ int32_t ctgRefreshTbMeta(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgTbMetaCtx*
|
|||
}
|
||||
|
||||
if (CTG_IS_META_NULL(output->metaType)) {
|
||||
ctgError("no tbmeta got, tbName:%s", tNameGetTableName(ctx->pName));
|
||||
ctgError("tb:%s, no tbmeta got", tNameGetTableName(ctx->pName));
|
||||
CTG_ERR_JRET(ctgRemoveTbMetaFromCache(pCtg, ctx->pName, false));
|
||||
CTG_ERR_JRET(CTG_ERR_CODE_TABLE_NOT_EXIST);
|
||||
}
|
||||
|
||||
if (CTG_IS_META_TABLE(output->metaType)) {
|
||||
ctgDebug("tbmeta got, dbFName:%s, tbName:%s, tbType:%d", output->dbFName, output->tbName,
|
||||
output->tbMeta->tableType);
|
||||
ctgDebug("tb:%s, tbmeta got, db:%s, tbType:%d", output->tbName, output->dbFName, output->tbMeta->tableType);
|
||||
} else {
|
||||
ctgDebug("tbmeta got, dbFName:%s, tbName:%s, tbType:%d, stbMetaGot:%d", output->dbFName, output->ctbName,
|
||||
ctgDebug("tb:%s, tbmeta got, db:%s, tbType:%d, stbMetaGot:%d", output->ctbName, output->dbFName,
|
||||
output->ctbMeta.tableType, CTG_IS_META_BOTH(output->metaType));
|
||||
}
|
||||
|
||||
|
@ -238,7 +237,7 @@ int32_t ctgGetTbMeta(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgTbMetaCtx* ctx
|
|||
|
||||
CTG_ERR_JRET(ctgReadTbMetaFromCache(pCtg, &stbCtx, pTableMeta));
|
||||
if (NULL == *pTableMeta) {
|
||||
ctgDebug("stb no longer exist, dbFName:%s, tbName:%s", output->dbFName, ctx->pName->tname);
|
||||
ctgDebug("tb:%s, stb no longer exist, db:%s", ctx->pName->tname, output->dbFName);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -267,7 +266,7 @@ _return:
|
|||
taosMemoryFreeClear(output);
|
||||
|
||||
if (*pTableMeta) {
|
||||
ctgDebug("tbmeta returned, tbName:%s, tbType:%d", ctx->pName->tname, (*pTableMeta)->tableType);
|
||||
ctgDebug("tb:%s, tbmeta returned, tbType:%d", ctx->pName->tname, (*pTableMeta)->tableType);
|
||||
ctgdShowTableMeta(pCtg, ctx->pName->tname, *pTableMeta);
|
||||
}
|
||||
|
||||
|
@ -508,7 +507,7 @@ int32_t ctgGetTbDistVgInfo(SCatalog* pCtg, SRequestConnInfo* pConn, SName* pTabl
|
|||
CTG_ERR_JRET(ctgGenerateVgList(pCtg, vgHash, pVgList, db));
|
||||
} else {
|
||||
// USE HASH METHOD INSTEAD OF VGID IN TBMETA
|
||||
ctgError("invalid method to get none stb vgInfo, tbType:%d", tbMeta->tableType);
|
||||
ctgError("tb:%s, invalid method to get none stb vgInfo, tbType:%d", pTableName->tname, tbMeta->tableType);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INVALID_INPUT);
|
||||
|
||||
#if 0
|
||||
|
@ -557,7 +556,7 @@ _return:
|
|||
|
||||
int32_t ctgGetTbHashVgroup(SCatalog* pCtg, SRequestConnInfo* pConn, const SName* pTableName, SVgroupInfo* pVgroup, bool* exists) {
|
||||
if (IS_SYS_DBNAME(pTableName->dbname)) {
|
||||
ctgError("no valid vgInfo for db, dbname:%s", pTableName->dbname);
|
||||
ctgError("db:%s, no valid vgInfo for db", pTableName->dbname);
|
||||
CTG_ERR_RET(TSDB_CODE_CTG_INVALID_INPUT);
|
||||
}
|
||||
|
||||
|
@ -570,7 +569,7 @@ int32_t ctgGetTbHashVgroup(SCatalog* pCtg, SRequestConnInfo* pConn, const SName*
|
|||
CTG_ERR_JRET(ctgGetDBVgInfo(pCtg, pConn, db, &dbCache, &vgInfo, exists));
|
||||
|
||||
if (exists && false == *exists) {
|
||||
ctgDebug("db %s vgInfo not in cache", pTableName->dbname);
|
||||
ctgDebug("db:%s, vgInfo not in cache", pTableName->dbname);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -592,7 +591,7 @@ _return:
|
|||
|
||||
int32_t ctgGetTbsHashVgId(SCatalog* pCtg, SRequestConnInfo* pConn, int32_t acctId, const char* pDb, const char* pTbs[], int32_t tbNum, int32_t* vgId) {
|
||||
if (IS_SYS_DBNAME(pDb)) {
|
||||
ctgError("no valid vgInfo for db, dbname:%s", pDb);
|
||||
ctgError("db:%s, no valid vgInfo for db", pDb);
|
||||
CTG_ERR_RET(TSDB_CODE_CTG_INVALID_INPUT);
|
||||
}
|
||||
|
||||
|
@ -798,7 +797,7 @@ _return:
|
|||
|
||||
|
||||
int32_t catalogInit(SCatalogCfg* cfg) {
|
||||
qDebug("catalogInit start");
|
||||
qInfo("catalog init");
|
||||
if (gCtgMgmt.pCluster) {
|
||||
qError("catalog already initialized");
|
||||
CTG_ERR_RET(TSDB_CODE_CTG_INVALID_INPUT);
|
||||
|
@ -890,8 +889,8 @@ int32_t catalogInit(SCatalogCfg* cfg) {
|
|||
|
||||
CTG_ERR_RET(ctgStartUpdateThread());
|
||||
|
||||
qDebug("catalog initialized, maxDb:%u, maxTbl:%u, dbRentSec:%u, stbRentSec:%u", gCtgMgmt.cfg.maxDBCacheNum,
|
||||
gCtgMgmt.cfg.maxTblCacheNum, gCtgMgmt.cfg.dbRentSec, gCtgMgmt.cfg.stbRentSec);
|
||||
qInfo("catalog initialized, maxDb:%u, maxTbl:%u, dbRentSec:%u, stbRentSec:%u", gCtgMgmt.cfg.maxDBCacheNum,
|
||||
gCtgMgmt.cfg.maxTblCacheNum, gCtgMgmt.cfg.dbRentSec, gCtgMgmt.cfg.stbRentSec);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -917,7 +916,7 @@ int32_t catalogGetHandle(int64_t clusterId, SCatalog** catalogHandle) {
|
|||
if (ctg && (*ctg)) {
|
||||
*catalogHandle = *ctg;
|
||||
CTG_STAT_HIT_INC(CTG_CI_CLUSTER, 1);
|
||||
qDebug("got catalog handle from cache, clusterId:0x%" PRIx64 ", CTG:%p", clusterId, *ctg);
|
||||
qDebug("CTG:%p, get catalog handle from cache, clusterId:0x%" PRIx64, *ctg, clusterId);
|
||||
CTG_API_LEAVE(TSDB_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
|
@ -961,7 +960,7 @@ int32_t catalogGetHandle(int64_t clusterId, SCatalog** catalogHandle) {
|
|||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
qDebug("add CTG to cache, clusterId:0x%" PRIx64 ", CTG:%p", clusterId, clusterCtg);
|
||||
qDebug("CTG:%p, add CTG to cache, clusterId:0x%" PRIx64, clusterCtg, clusterId);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -1001,7 +1000,7 @@ int32_t catalogGetDBVgVersion(SCatalog* pCtg, const char* dbFName, int32_t* vers
|
|||
|
||||
ctgReleaseVgInfoToCache(pCtg, dbCache);
|
||||
|
||||
ctgDebug("Got db vgVersion from cache, dbFName:%s, vgVersion:%d", dbFName, *version);
|
||||
ctgDebug("db:%s, get db vgVersion from cache, vgVersion:%d", dbFName, *version);
|
||||
|
||||
CTG_API_LEAVE(TSDB_CODE_SUCCESS);
|
||||
|
||||
|
@ -1069,7 +1068,7 @@ int32_t catalogGetDBVgInfo(SCatalog* pCtg, SRequestConnInfo* pConn, const char*
|
|||
pInfo->hashMethod = dbInfo->hashMethod;
|
||||
pInfo->vgNum = taosHashGetSize(dbInfo->vgHash);
|
||||
if (pInfo->vgNum <= 0) {
|
||||
ctgError("invalid vgNum %d in db %s's vgHash", pInfo->vgNum, dbFName);
|
||||
ctgError("db:%s, invalid vgNum %d in db vgHash", dbFName, pInfo->vgNum);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
|
@ -1529,13 +1528,13 @@ _return:
|
|||
if (pJob) {
|
||||
int32_t code2 = taosReleaseRef(gCtgMgmt.jobPool, pJob->refId);
|
||||
if (TSDB_CODE_SUCCESS) {
|
||||
qError("release catalog job refId %" PRId64 "falied, error:%s", pJob->refId, tstrerror(code2));
|
||||
qError("release catalog job refId:%" PRId64 " falied, error:%s", pJob->refId, tstrerror(code2));
|
||||
}
|
||||
|
||||
if (code) {
|
||||
code2 = taosRemoveRef(gCtgMgmt.jobPool, pJob->refId);
|
||||
if (TSDB_CODE_SUCCESS) {
|
||||
qError("remove catalog job refId %" PRId64 "falied, error:%s", pJob->refId, tstrerror(code2));
|
||||
qError("remove catalog job refId:%" PRId64 " falied, error:%s", pJob->refId, tstrerror(code2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1827,8 +1826,8 @@ int32_t catalogUpdateDynViewVer(SCatalog* pCtg, SDynViewVersion* pVer) {
|
|||
atomic_store_64(&pCtg->dynViewVer.svrBootTs, pVer->svrBootTs);
|
||||
atomic_store_64(&pCtg->dynViewVer.dynViewVer, pVer->dynViewVer);
|
||||
|
||||
ctgDebug("cluster %" PRIx64 " svrBootTs updated to %" PRId64, pCtg->clusterId, pVer->svrBootTs);
|
||||
ctgDebug("cluster %" PRIx64 " dynViewVer updated to %" PRId64, pCtg->clusterId, pVer->dynViewVer);
|
||||
ctgDebug("clusterId:0x%" PRIx64 ", svrBootTs updated to %" PRId64, pCtg->clusterId, pVer->svrBootTs);
|
||||
ctgDebug("clusterId:0x%" PRIx64 ", dynViewVer updated to %" PRId64, pCtg->clusterId, pVer->dynViewVer);
|
||||
|
||||
CTG_API_LEAVE(TSDB_CODE_SUCCESS);
|
||||
}
|
||||
|
@ -1973,7 +1972,7 @@ int32_t catalogClearCache(void) {
|
|||
|
||||
int32_t code = ctgClearCacheEnqueue(NULL, false, false, false, true);
|
||||
|
||||
qInfo("clear catalog cache end, code: %s", tstrerror(code));
|
||||
qInfo("clear catalog cache end, code:%s", tstrerror(code));
|
||||
|
||||
CTG_API_LEAVE_NOLOCK(code);
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ int32_t ctgInitGetTbMetaTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), name->tname);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -99,7 +99,7 @@ int32_t ctgInitGetTbMetasTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
ctx->pNames = param;
|
||||
ctx->pResList = taosArrayInit(pJob->tbMetaNum, sizeof(SMetaRes));
|
||||
if (NULL == ctx->pResList) {
|
||||
qError("QID:0x%" PRIx64 " taosArrayInit %d SMetaRes %d failed", pJob->queryId, pJob->tbMetaNum,
|
||||
qError("QID:0x%" PRIx64 ", taosArrayInit %d SMetaRes %d failed", pJob->queryId, pJob->tbMetaNum,
|
||||
(int32_t)sizeof(SMetaRes));
|
||||
ctgFreeTask(&task, true);
|
||||
CTG_ERR_RET(terrno);
|
||||
|
@ -110,7 +110,7 @@ int32_t ctgInitGetTbMetasTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbNum:%lu, tbNum:%d", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, dbNum:%lu, tbNum:%d", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), taosArrayGetSize(ctx->pNames), pJob->tbMetaNum);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -138,7 +138,7 @@ int32_t ctgInitGetDbVgTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbFName:%s", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, dbFName:%s", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), dbFName);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -166,7 +166,7 @@ int32_t ctgInitGetDbCfgTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbFName:%s", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, dbFName:%s", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), dbFName);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -194,7 +194,7 @@ int32_t ctgInitGetDbInfoTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbFName:%s", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, dbFName:%s", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), dbFName);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -228,7 +228,7 @@ int32_t ctgInitGetTbHashTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, tableName:%s", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, tableName:%s", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), name->tname);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -250,7 +250,7 @@ int32_t ctgInitGetTbHashsTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
ctx->pNames = param;
|
||||
ctx->pResList = taosArrayInit(pJob->tbHashNum, sizeof(SMetaRes));
|
||||
if (NULL == ctx->pResList) {
|
||||
qError("QID:0x%" PRIx64 " taosArrayInit %d SMetaRes %d failed", pJob->queryId, pJob->tbHashNum,
|
||||
qError("QID:0x%" PRIx64 ", taosArrayInit %d SMetaRes %d failed", pJob->queryId, pJob->tbHashNum,
|
||||
(int32_t)sizeof(SMetaRes));
|
||||
ctgFreeTask(&task, true);
|
||||
CTG_ERR_RET(terrno);
|
||||
|
@ -261,7 +261,7 @@ int32_t ctgInitGetTbHashsTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbNum:%lu, tbNum:%d", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, dbNum:%lu, tbNum:%d", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), taosArrayGetSize(ctx->pNames), pJob->tbHashNum);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -280,7 +280,7 @@ int32_t ctgInitGetQnodeTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type));
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type));
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ int32_t ctgInitGetDnodeTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type));
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type));
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ int32_t ctgInitGetIndexTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, indexFName:%s", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, indexFName:%s", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), name);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -353,7 +353,7 @@ int32_t ctgInitGetUdfTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, udfName:%s", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, udfName:%s", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), name);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -381,7 +381,7 @@ int32_t ctgInitGetUserTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, user:%s", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, user:%s", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), user->user);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -399,7 +399,7 @@ int32_t ctgInitGetSvrVerTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type));
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized", pJob->queryId, taskIdx, ctgTaskTypeStr(task.type));
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -431,7 +431,7 @@ int32_t ctgInitGetTbIndexTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), name->tname);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -464,7 +464,7 @@ int32_t ctgInitGetTbCfgTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), name->tname);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -497,7 +497,7 @@ int32_t ctgInitGetTbTagTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, tbName:%s", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), name->tname);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -520,7 +520,7 @@ int32_t ctgInitGetViewsTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
ctx->forceFetch = p->forceFetch;
|
||||
ctx->pResList = taosArrayInit(pJob->viewNum, sizeof(SMetaRes));
|
||||
if (NULL == ctx->pResList) {
|
||||
qError("QID:0x%" PRIx64 " taosArrayInit %d SMetaRes %d failed", pJob->queryId, pJob->viewNum,
|
||||
qError("QID:0x%" PRIx64 ", taosArrayInit %d SMetaRes %d failed", pJob->queryId, pJob->viewNum,
|
||||
(int32_t)sizeof(SMetaRes));
|
||||
ctgFreeTask(&task, true);
|
||||
CTG_ERR_RET(terrno);
|
||||
|
@ -531,7 +531,7 @@ int32_t ctgInitGetViewsTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
|
|||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " the %dth task type %s initialized, dbNum:%lu, viewNum:%d", pJob->queryId, taskIdx,
|
||||
qDebug("QID:0x%" PRIx64 ", the %dth task type %s initialized, dbNum:%lu, viewNum:%d", pJob->queryId, taskIdx,
|
||||
ctgTaskTypeStr(task.type), taosArrayGetSize(ctx->pNames), pJob->viewNum);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -552,7 +552,7 @@ int32_t ctgInitGetTbTSMATask(SCtgJob* pJob, int32_t taskId, void* param) {
|
|||
pTaskCtx->pNames = param;
|
||||
pTaskCtx->pResList = taosArrayInit(pJob->tbTsmaNum, sizeof(SMetaRes));
|
||||
if (NULL == pTaskCtx->pResList) {
|
||||
qError("QID:0x%" PRIx64 " taosArrayInit %d SMetaRes %d failed", pJob->queryId, pJob->tbTsmaNum,
|
||||
qError("QID:0x%" PRIx64 ", taosArrayInit %d SMetaRes %d failed", pJob->queryId, pJob->tbTsmaNum,
|
||||
(int32_t)sizeof(SMetaRes));
|
||||
ctgFreeTask(&task, true);
|
||||
CTG_ERR_RET(terrno);
|
||||
|
@ -580,7 +580,7 @@ int32_t ctgInitGetTSMATask(SCtgJob* pJob, int32_t taskId, void* param) {
|
|||
pTaskCtx->pNames = param;
|
||||
pTaskCtx->pResList = taosArrayInit(pJob->tsmaNum, sizeof(SMetaRes));
|
||||
if (NULL == pTaskCtx->pResList) {
|
||||
qError("QID:0x%" PRIx64 " taosArrayInit %d SMetaRes %d failed", pJob->queryId, pJob->tsmaNum,
|
||||
qError("QID:0x%" PRIx64 ", taosArrayInit %d SMetaRes %d failed", pJob->queryId, pJob->tsmaNum,
|
||||
(int32_t)sizeof(SMetaRes));
|
||||
ctgFreeTask(&task, true);
|
||||
CTG_ERR_RET(terrno);
|
||||
|
@ -609,7 +609,7 @@ static int32_t ctgInitGetTbNamesTask(SCtgJob* pJob, int32_t taskId, void* param)
|
|||
pTaskCtx->pNames = param;
|
||||
pTaskCtx->pResList = taosArrayInit(pJob->tbNameNum, sizeof(SMetaRes));
|
||||
if (NULL == pTaskCtx->pResList) {
|
||||
qError("QID:0x%" PRIx64 " taosArrayInit %d SMetaRes %d failed", pJob->queryId, pJob->tbNameNum,
|
||||
qError("QID:0x%" PRIx64 ", taosArrayInit %d SMetaRes %d failed", pJob->queryId, pJob->tbNameNum,
|
||||
(int32_t)sizeof(SMetaRes));
|
||||
ctgFreeTask(&task, true);
|
||||
CTG_ERR_RET(terrno);
|
||||
|
@ -873,7 +873,7 @@ int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgJob** job, const
|
|||
|
||||
*job = taosMemoryCalloc(1, sizeof(SCtgJob));
|
||||
if (NULL == *job) {
|
||||
ctgError("failed to calloc, size:%d,QID:0x%" PRIx64, (int32_t)sizeof(SCtgJob), pConn->requestId);
|
||||
ctgError("failed to calloc, size:%d, QID:0x%" PRIx64, (int32_t)sizeof(SCtgJob), pConn->requestId);
|
||||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
|
@ -1053,18 +1053,18 @@ int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgJob** job, const
|
|||
|
||||
pJob->refId = taosAddRef(gCtgMgmt.jobPool, pJob);
|
||||
if (pJob->refId < 0) {
|
||||
ctgError("add job to ref failed, error: %s", tstrerror(terrno));
|
||||
ctgError("add job to ref failed, error:%s", tstrerror(terrno));
|
||||
CTG_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
void* p = taosAcquireRef(gCtgMgmt.jobPool, pJob->refId);
|
||||
if (NULL == p) {
|
||||
ctgError("acquire job from ref failed, refId:%" PRId64 ", error: %s", pJob->refId, tstrerror(terrno));
|
||||
ctgError("acquire job from ref failed, refId:%" PRId64 ", error:%s", pJob->refId, tstrerror(terrno));
|
||||
CTG_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
double el = (taosGetTimestampUs() - st) / 1000.0;
|
||||
qDebug("QID:0x%" PRIx64 ", jobId: 0x%" PRIx64 " initialized, task num %d, forceUpdate %d, elapsed time:%.2f ms",
|
||||
qDebug("QID:0x%" PRIx64 ", jobId:0x%" PRIx64 " initialized, task num:%d, forceUpdate:%d, elapsed time:%.2f ms",
|
||||
pJob->queryId, pJob->refId, taskNum, pReq->forceUpdate, el);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
||||
|
@ -1478,16 +1478,16 @@ _return:
|
|||
int32_t ctgCallUserCb(void* param) {
|
||||
SCtgJob* pJob = (SCtgJob*)param;
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " ctg start to call user cb with rsp %s", pJob->queryId, tstrerror(pJob->jobResCode));
|
||||
qDebug("QID:0x%" PRIx64 ", ctg start to call user cb with rsp %s", pJob->queryId, tstrerror(pJob->jobResCode));
|
||||
|
||||
(*pJob->userFp)(&pJob->jobRes, pJob->userParam, pJob->jobResCode);
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " ctg end to call user cb", pJob->queryId);
|
||||
qDebug("QID:0x%" PRIx64 ", ctg end to call user cb", pJob->queryId);
|
||||
|
||||
int64_t refId = pJob->refId;
|
||||
int32_t code = taosRemoveRef(gCtgMgmt.jobPool, refId);
|
||||
if (code) {
|
||||
qError("QID:0x%" PRIx64 " remove ctg job %" PRId64 " from jobPool failed, error:%s", pJob->queryId, refId,
|
||||
qError("QID:0x%" PRIx64 ", remove ctg job %" PRId64 " from jobPool failed, error:%s", pJob->queryId, refId,
|
||||
tstrerror(code));
|
||||
}
|
||||
|
||||
|
@ -1498,7 +1498,7 @@ void ctgUpdateJobErrCode(SCtgJob* pJob, int32_t errCode) {
|
|||
if (!NEED_CLIENT_REFRESH_VG_ERROR(errCode) || errCode == TSDB_CODE_SUCCESS) return;
|
||||
|
||||
atomic_store_32(&pJob->jobResCode, errCode);
|
||||
qDebug("QID:0x%" PRIx64 " ctg job errCode updated to %s", pJob->queryId, tstrerror(errCode));
|
||||
qDebug("QID:0x%" PRIx64 ", ctg job errCode updated to %s", pJob->queryId, tstrerror(errCode));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1510,7 +1510,7 @@ int32_t ctgHandleTaskEnd(SCtgTask* pTask, int32_t rspCode) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " task %d end with res %s", pJob->queryId, pTask->taskId, tstrerror(rspCode));
|
||||
qDebug("QID:0x%" PRIx64 ", task:%d end with result:%s", pJob->queryId, pTask->taskId, tstrerror(rspCode));
|
||||
|
||||
pTask->code = rspCode;
|
||||
pTask->status = CTG_TASK_DONE;
|
||||
|
@ -1519,7 +1519,7 @@ int32_t ctgHandleTaskEnd(SCtgTask* pTask, int32_t rspCode) {
|
|||
|
||||
int32_t taskDone = atomic_add_fetch_32(&pJob->taskDone, 1);
|
||||
if (taskDone < taosArrayGetSize(pJob->pTasks)) {
|
||||
qDebug("QID:0x%" PRIx64 " task done: %d, total: %d", pJob->queryId, taskDone,
|
||||
qDebug("QID:0x%" PRIx64 ", task done:%d, total:%d", pJob->queryId, taskDone,
|
||||
(int32_t)taosArrayGetSize(pJob->pTasks));
|
||||
|
||||
ctgUpdateJobErrCode(pJob, rspCode);
|
||||
|
@ -2769,7 +2769,7 @@ _return:
|
|||
if (TSDB_CODE_MND_SMA_NOT_EXIST == code) {
|
||||
code = TSDB_CODE_SUCCESS;
|
||||
} else {
|
||||
ctgTaskError("Get tsma for %d.%s.%s failed with err: %s", pName->acctId, pName->dbname, pName->tname,
|
||||
ctgTaskError("get tsma for %d.%s.%s failed with err:%s", pName->acctId, pName->dbname, pName->tname,
|
||||
tstrerror(code));
|
||||
}
|
||||
}
|
||||
|
@ -2884,7 +2884,7 @@ int32_t ctgHandleGetTbTSMARsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf
|
|||
pTsmaInfo->delayDuration = TMAX(pRsp->progressDelay, pTsmaInfo->delayDuration);
|
||||
pTsmaInfo->fillHistoryFinished = pTsmaInfo->fillHistoryFinished && pRsp->fillHisFinished;
|
||||
|
||||
qDebug("received stream progress for tsma %s rsp history: %d vnode: %d, delay: %" PRId64, pTsmaInfo->name,
|
||||
qDebug("received stream progress for tsma %s rsp history:%d vnode:%d, delay:%" PRId64, pTsmaInfo->name,
|
||||
pRsp->fillHisFinished, pRsp->subFetchIdx, pRsp->progressDelay);
|
||||
|
||||
if (atomic_add_fetch_32(&pFetch->finishedSubFetchNum, 1) == pFetch->subFetchNum) {
|
||||
|
@ -2937,7 +2937,7 @@ int32_t ctgHandleGetTbTSMARsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf
|
|||
pFetch->tsmaSourceTbName = *pTbName;
|
||||
|
||||
if (CTG_IS_META_NULL(pOut->metaType)) {
|
||||
ctgTaskError("no tbmeta found when fetching tsma source tb meta: %s.%s", pTbName->dbname, pTbName->tname);
|
||||
ctgTaskError("no tbmeta found when fetching tsma source tb meta:%s.%s", pTbName->dbname, pTbName->tname);
|
||||
(void)ctgRemoveTbMetaFromCache(pCtg, pTbName, false); // ignore cache error
|
||||
CTG_ERR_JRET(CTG_ERR_CODE_TABLE_NOT_EXIST);
|
||||
}
|
||||
|
@ -2979,7 +2979,7 @@ _return:
|
|||
if (TSDB_CODE_MND_SMA_NOT_EXIST == code) {
|
||||
code = TSDB_CODE_SUCCESS;
|
||||
} else {
|
||||
ctgTaskError("Get tsma for %d.%s.%s faield with err: %s", pTbName->acctId, pTbName->dbname, pTbName->tname,
|
||||
ctgTaskError("get tsma for %d.%s.%s faield with err:%s", pTbName->acctId, pTbName->dbname, pTbName->tname,
|
||||
tstrerror(code));
|
||||
}
|
||||
}
|
||||
|
@ -3104,7 +3104,7 @@ int32_t ctgLaunchGetTbMetasTask(SCtgTask* pTask) {
|
|||
CTG_ERR_RET(TSDB_CODE_CTG_INVALID_INPUT);
|
||||
}
|
||||
|
||||
ctgDebug("start to check tb metas in db %s, tbNum %ld", pReq->dbFName, taosArrayGetSize(pReq->pTables));
|
||||
ctgDebug("start to check tb metas in db:%s, tbNum:%d", pReq->dbFName, (int32_t)taosArrayGetSize(pReq->pTables));
|
||||
CTG_ERR_RET(ctgGetTbMetasFromCache(pCtg, pConn, pCtx, i, &fetchIdx, baseResIdx, pReq->pTables));
|
||||
baseResIdx += taosArrayGetSize(pReq->pTables);
|
||||
}
|
||||
|
@ -3690,7 +3690,7 @@ int32_t ctgLaunchGetUserTask(SCtgTask* pTask) {
|
|||
if (inCache) {
|
||||
pTask->res = rsp.pRawRes;
|
||||
|
||||
ctgTaskDebug("Final res got, pass:[%d,%d], pCond:[%p,%p]", rsp.pRawRes->pass[0], rsp.pRawRes->pass[1],
|
||||
ctgTaskDebug("final res got, pass:[%d,%d], pCond:[%p,%p]", rsp.pRawRes->pass[0], rsp.pRawRes->pass[1],
|
||||
rsp.pRawRes->pCond[0], rsp.pRawRes->pCond[1]);
|
||||
|
||||
CTG_ERR_RET(ctgHandleTaskEnd(pTask, 0));
|
||||
|
@ -4015,7 +4015,7 @@ static int32_t ctgLaunchGetTbNamesTask(SCtgTask* pTask) {
|
|||
CTG_ERR_RET(TSDB_CODE_CTG_INVALID_INPUT);
|
||||
}
|
||||
|
||||
ctgDebug("start to check tbname metas in db %s, tbNum %ld", pReq->dbFName, taosArrayGetSize(pReq->pTables));
|
||||
ctgDebug("start to check tbname metas in db:%s, tbNum:%d", pReq->dbFName, (int32_t)taosArrayGetSize(pReq->pTables));
|
||||
CTG_ERR_RET(ctgGetTbNamesFromCache(pCtg, pConn, pCtx, i, &fetchIdx, baseResIdx, pReq->pTables));
|
||||
baseResIdx += taosArrayGetSize(pReq->pTables);
|
||||
}
|
||||
|
@ -4374,7 +4374,7 @@ int32_t ctgLaunchJob(SCtgJob* pJob) {
|
|||
CTG_ERR_RET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " ctg launch [%dth] task", pJob->queryId, pTask->taskId);
|
||||
qDebug("QID:0x%" PRIx64 ", ctg launch [%dth] task", pJob->queryId, pTask->taskId);
|
||||
CTG_ERR_RET((*gCtgAsyncFps[pTask->type].launchFp)(pTask));
|
||||
|
||||
pTask = taosArrayGet(pJob->pTasks, i);
|
||||
|
@ -4387,7 +4387,7 @@ int32_t ctgLaunchJob(SCtgJob* pJob) {
|
|||
}
|
||||
|
||||
if (taskNum <= 0) {
|
||||
qDebug("QID:0x%" PRIx64 " ctg call user callback with rsp %s", pJob->queryId, tstrerror(pJob->jobResCode));
|
||||
qDebug("QID:0x%" PRIx64 ", ctg call user callback with rsp %s", pJob->queryId, tstrerror(pJob->jobResCode));
|
||||
|
||||
CTG_ERR_RET(taosAsyncExec(ctgCallUserCb, pJob, NULL));
|
||||
#if CTG_BATCH_FETCH
|
||||
|
|
|
@ -67,7 +67,7 @@ int32_t ctgRLockVgInfo(SCatalog *pCtg, SCtgDBCache *dbCache, bool *inCache) {
|
|||
if (dbCache->deleted) {
|
||||
CTG_UNLOCK(CTG_READ, &dbCache->vgCache.vgLock);
|
||||
|
||||
ctgDebug("db is dropping, dbId:0x%" PRIx64, dbCache->dbId);
|
||||
ctgDebug("dbId:0x%" PRIx64 ", db is dropping", dbCache->dbId);
|
||||
|
||||
*inCache = false;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -77,7 +77,7 @@ int32_t ctgRLockVgInfo(SCatalog *pCtg, SCtgDBCache *dbCache, bool *inCache) {
|
|||
CTG_UNLOCK(CTG_READ, &dbCache->vgCache.vgLock);
|
||||
|
||||
*inCache = false;
|
||||
ctgDebug("db vgInfo is empty, dbId:0x%" PRIx64, dbCache->dbId);
|
||||
ctgDebug("dbId:0x%" PRIx64 ", db vgInfo is empty", dbCache->dbId);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ int32_t ctgWLockVgInfo(SCatalog *pCtg, SCtgDBCache *dbCache) {
|
|||
CTG_LOCK(CTG_WRITE, &dbCache->vgCache.vgLock);
|
||||
|
||||
if (dbCache->deleted) {
|
||||
ctgDebug("db is dropping, dbId:0x%" PRIx64, dbCache->dbId);
|
||||
ctgDebug("dbId:0x%" PRIx64 ", db is dropping", dbCache->dbId);
|
||||
CTG_UNLOCK(CTG_WRITE, &dbCache->vgCache.vgLock);
|
||||
CTG_ERR_RET(TSDB_CODE_CTG_DB_DROPPED);
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ int32_t ctgAcquireDBCacheImpl(SCatalog *pCtg, const char *dbFName, SCtgDBCache *
|
|||
if (NULL == dbCache) {
|
||||
*pCache = NULL;
|
||||
CTG_CACHE_NHIT_INC(CTG_CI_DB, 1);
|
||||
ctgDebug("db not in cache, dbFName:%s", dbFName);
|
||||
ctgTrace("db:%s, db not in cache", dbFName);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ int32_t ctgAcquireDBCacheImpl(SCatalog *pCtg, const char *dbFName, SCtgDBCache *
|
|||
|
||||
*pCache = NULL;
|
||||
CTG_CACHE_NHIT_INC(CTG_CI_DB, 1);
|
||||
ctgDebug("db is removing from cache, dbFName:%s", dbFName);
|
||||
ctgDebug("db:%s, db is removing from cache", dbFName);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -229,14 +229,14 @@ int32_t ctgAcquireVgInfoFromCache(SCatalog *pCtg, const char *dbFName, SCtgDBCac
|
|||
SCtgDBCache *dbCache = NULL;
|
||||
CTG_ERR_JRET(ctgAcquireDBCache(pCtg, dbFName, &dbCache));
|
||||
if (NULL == dbCache) {
|
||||
ctgDebug("db %s not in cache", dbFName);
|
||||
ctgTrace("db:%s, db not in cache", dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
bool inCache = false;
|
||||
CTG_ERR_JRET(ctgRLockVgInfo(pCtg, dbCache, &inCache));
|
||||
if (!inCache) {
|
||||
ctgDebug("vgInfo of db %s not in cache", dbFName);
|
||||
ctgDebug("db:%s, vgInfo not in cache", dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ int32_t ctgAcquireVgInfoFromCache(SCatalog *pCtg, const char *dbFName, SCtgDBCac
|
|||
|
||||
CTG_CACHE_HIT_INC(CTG_CI_DB_VGROUP, 1);
|
||||
|
||||
ctgDebug("Got db vgInfo from cache, dbFName:%s", dbFName);
|
||||
ctgDebug("db:%s, get db vgInfo from cache", dbFName);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
||||
|
@ -268,26 +268,26 @@ int32_t ctgAcquireTbMetaFromCache(SCatalog *pCtg, const char *dbFName, const cha
|
|||
|
||||
CTG_ERR_JRET(ctgAcquireDBCache(pCtg, dbFName, &dbCache));
|
||||
if (NULL == dbCache) {
|
||||
ctgDebug("db %s not in cache", dbFName);
|
||||
ctgDebug("tb:%s, db not in cache, db:%s", tbName, dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
pCache = taosHashAcquire(dbCache->tbCache, tbName, strlen(tbName));
|
||||
if (NULL == pCache) {
|
||||
ctgDebug("tb %s not in cache, dbFName:%s", tbName, dbFName);
|
||||
ctgDebug("tb:%s, tb not in cache, db:%s", tbName, dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
CTG_LOCK(CTG_READ, &pCache->metaLock);
|
||||
if (NULL == pCache->pMeta) {
|
||||
ctgDebug("tb %s meta not in cache, dbFName:%s", tbName, dbFName);
|
||||
ctgDebug("tb:%s, meta not in cache, db:%s", tbName, dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
*pDb = dbCache;
|
||||
*pTb = pCache;
|
||||
|
||||
ctgDebug("tb %s meta got in cache, dbFName:%s", tbName, dbFName);
|
||||
ctgDebug("tb:%s, meta get from cache, db:%s", tbName, dbFName);
|
||||
|
||||
CTG_META_HIT_INC(pCache->pMeta->tableType);
|
||||
|
||||
|
@ -311,14 +311,14 @@ int32_t ctgAcquireVgMetaFromCache(SCatalog *pCtg, const char *dbFName, const cha
|
|||
|
||||
CTG_ERR_JRET(ctgAcquireDBCache(pCtg, dbFName, &dbCache));
|
||||
if (NULL == dbCache) {
|
||||
ctgDebug("db %s not in cache", dbFName);
|
||||
ctgDebug("tb:%s, db not in cache, db:%s", tbName, dbFName);
|
||||
CTG_CACHE_NHIT_INC(CTG_CI_DB_VGROUP, 1);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
CTG_ERR_JRET(ctgRLockVgInfo(pCtg, dbCache, &vgInCache));
|
||||
if (!vgInCache) {
|
||||
ctgDebug("vgInfo of db %s not in cache", dbFName);
|
||||
ctgDebug("tb:%s, vgInfo of db not in cache, db:%s", tbName, dbFName);
|
||||
CTG_CACHE_NHIT_INC(CTG_CI_DB_VGROUP, 1);
|
||||
goto _return;
|
||||
}
|
||||
|
@ -327,25 +327,25 @@ int32_t ctgAcquireVgMetaFromCache(SCatalog *pCtg, const char *dbFName, const cha
|
|||
|
||||
CTG_CACHE_HIT_INC(CTG_CI_DB_VGROUP, 1);
|
||||
|
||||
ctgDebug("Got db vgInfo from cache, dbFName:%s", dbFName);
|
||||
ctgDebug("tb:%s, get db vgInfo from cache, db:%s", tbName, dbFName);
|
||||
|
||||
tbCache = taosHashAcquire(dbCache->tbCache, tbName, strlen(tbName));
|
||||
if (NULL == tbCache) {
|
||||
ctgDebug("tb %s not in cache, dbFName:%s", tbName, dbFName);
|
||||
ctgDebug("tb:%s, not in cache, db:%s", tbName, dbFName);
|
||||
CTG_META_NHIT_INC();
|
||||
goto _return;
|
||||
}
|
||||
|
||||
CTG_LOCK(CTG_READ, &tbCache->metaLock);
|
||||
if (NULL == tbCache->pMeta) {
|
||||
ctgDebug("tb %s meta not in cache, dbFName:%s", tbName, dbFName);
|
||||
ctgDebug("tb:%s, meta not in cache, db:%s", tbName, dbFName);
|
||||
CTG_META_NHIT_INC();
|
||||
goto _return;
|
||||
}
|
||||
|
||||
*pTb = tbCache;
|
||||
|
||||
ctgDebug("tb %s meta got in cache, dbFName:%s", tbName, dbFName);
|
||||
ctgDebug("tb:%s, meta get from cache, db:%s", tbName, dbFName);
|
||||
|
||||
CTG_META_HIT_INC(tbCache->pMeta->tableType);
|
||||
|
||||
|
@ -378,19 +378,19 @@ int32_t ctgAcquireStbMetaFromCache(SCatalog *pCtg, char *dbFName, uint64_t suid,
|
|||
SCtgTbCache *pCache = NULL;
|
||||
ctgAcquireDBCache(pCtg, dbFName, &dbCache);
|
||||
if (NULL == dbCache) {
|
||||
ctgDebug("db %s not in cache", dbFName);
|
||||
ctgTrace("db:%s, db not in cache", dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
char *stName = taosHashAcquire(dbCache->stbCache, &suid, sizeof(suid));
|
||||
if (NULL == stName) {
|
||||
ctgDebug("stb 0x%" PRIx64 " not in cache, dbFName:%s", suid, dbFName);
|
||||
ctgDebug("stb:0x%" PRIx64 ", not in cache, db:%s", suid, dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
pCache = taosHashAcquire(dbCache->tbCache, stName, strlen(stName));
|
||||
if (NULL == pCache) {
|
||||
ctgDebug("stb 0x%" PRIx64 " name %s not in cache, dbFName:%s", suid, stName, dbFName);
|
||||
ctgDebug("stb:0x%" PRIx64 ", name %s not in cache, db:%s", suid, stName, dbFName);
|
||||
taosHashRelease(dbCache->stbCache, stName);
|
||||
goto _return;
|
||||
}
|
||||
|
@ -399,14 +399,14 @@ int32_t ctgAcquireStbMetaFromCache(SCatalog *pCtg, char *dbFName, uint64_t suid,
|
|||
|
||||
CTG_LOCK(CTG_READ, &pCache->metaLock);
|
||||
if (NULL == pCache->pMeta) {
|
||||
ctgDebug("stb 0x%" PRIx64 " meta not in cache, dbFName:%s", suid, dbFName);
|
||||
ctgDebug("stb:0x%" PRIx64 ", meta not in cache, db:%s", suid, dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
*pDb = dbCache;
|
||||
*pTb = pCache;
|
||||
|
||||
ctgDebug("stb 0x%" PRIx64 " meta got in cache, dbFName:%s", suid, dbFName);
|
||||
ctgDebug("stb:0x%" PRIx64 ", meta got in cache, db:%s", suid, dbFName);
|
||||
|
||||
CTG_META_HIT_INC(pCache->pMeta->tableType, 1);
|
||||
|
||||
|
@ -430,13 +430,13 @@ int32_t ctgAcquireStbMetaFromCache(SCtgDBCache *dbCache, SCatalog *pCtg, char *d
|
|||
SCtgTbCache *pCache = NULL;
|
||||
char *stName = taosHashAcquire(dbCache->stbCache, &suid, sizeof(suid));
|
||||
if (NULL == stName) {
|
||||
ctgDebug("stb 0x%" PRIx64 " not in cache, dbFName:%s", suid, dbFName);
|
||||
ctgDebug("stb:0x%" PRIx64 ", not in cache, db:%s", suid, dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
pCache = taosHashAcquire(dbCache->tbCache, stName, strlen(stName));
|
||||
if (NULL == pCache) {
|
||||
ctgDebug("stb 0x%" PRIx64 " name %s not in cache, dbFName:%s", suid, stName, dbFName);
|
||||
ctgDebug("stb:0x%" PRIx64 ", name %s not in cache, db:%s", suid, stName, dbFName);
|
||||
taosHashRelease(dbCache->stbCache, stName);
|
||||
goto _return;
|
||||
}
|
||||
|
@ -445,13 +445,13 @@ int32_t ctgAcquireStbMetaFromCache(SCtgDBCache *dbCache, SCatalog *pCtg, char *d
|
|||
|
||||
CTG_LOCK(CTG_READ, &pCache->metaLock);
|
||||
if (NULL == pCache->pMeta) {
|
||||
ctgDebug("stb 0x%" PRIx64 " meta not in cache, dbFName:%s", suid, dbFName);
|
||||
ctgDebug("stb:0x%" PRIx64 ", meta not in cache, db:%s", suid, dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
*pTb = pCache;
|
||||
|
||||
ctgDebug("stb 0x%" PRIx64 " meta got in cache, dbFName:%s", suid, dbFName);
|
||||
ctgDebug("stb:0x%" PRIx64 ", meta get from cache, db:%s", suid, dbFName);
|
||||
|
||||
CTG_META_HIT_INC(pCache->pMeta->tableType);
|
||||
|
||||
|
@ -475,27 +475,27 @@ int32_t ctgAcquireTbIndexFromCache(SCatalog *pCtg, char *dbFName, char *tbName,
|
|||
|
||||
CTG_ERR_JRET(ctgAcquireDBCache(pCtg, dbFName, &dbCache));
|
||||
if (NULL == dbCache) {
|
||||
ctgDebug("db %s not in cache", dbFName);
|
||||
ctgDebug("tb:%s, db not in cache, db:%s", tbName, dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
int32_t sz = 0;
|
||||
pCache = taosHashAcquire(dbCache->tbCache, tbName, strlen(tbName));
|
||||
if (NULL == pCache) {
|
||||
ctgDebug("tb %s not in cache, dbFName:%s", tbName, dbFName);
|
||||
ctgDebug("tb:%s, tb not in cache, db:%s", tbName, dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
CTG_LOCK(CTG_READ, &pCache->indexLock);
|
||||
if (NULL == pCache->pIndex) {
|
||||
ctgDebug("tb %s index not in cache, dbFName:%s", tbName, dbFName);
|
||||
ctgDebug("tb:%s, index not in cache, db:%s", tbName, dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
*pDb = dbCache;
|
||||
*pTb = pCache;
|
||||
|
||||
ctgDebug("tb %s index got in cache, dbFName:%s", tbName, dbFName);
|
||||
ctgDebug("tb:%s, index get from cache, db:%s", tbName, dbFName);
|
||||
|
||||
CTG_CACHE_HIT_INC(CTG_CI_TBL_SMA, 1);
|
||||
|
||||
|
@ -557,7 +557,7 @@ int32_t ctgCopyTbMeta(SCatalog *pCtg, SCtgTbMetaCtx *ctx, SCtgDBCache **pDb, SCt
|
|||
(*pTableMeta)->schemaExt = NULL;
|
||||
}
|
||||
|
||||
ctgDebug("Got tb %s meta from cache, type:%d, dbFName:%s", ctx->pName->tname, tbMeta->tableType, dbFName);
|
||||
ctgDebug("tb:%s, get meta from cache, type:%d, db:%s", ctx->pName->tname, tbMeta->tableType, dbFName);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -577,14 +577,14 @@ int32_t ctgCopyTbMeta(SCatalog *pCtg, SCtgTbMetaCtx *ctx, SCtgDBCache **pDb, SCt
|
|||
taosHashRelease(dbCache->tbCache, tbCache);
|
||||
*pTb = NULL;
|
||||
|
||||
ctgDebug("Got ctb %s meta from cache, will continue to get its stb meta, type:%d, dbFName:%s", ctx->pName->tname,
|
||||
ctgDebug("ctb:%s, get meta from cache, will continue to get its stb meta, tbType:%d, db:%s", ctx->pName->tname,
|
||||
ctx->tbInfo.tbType, dbFName);
|
||||
|
||||
CTG_ERR_RET(ctgAcquireStbMetaFromCache(dbCache, pCtg, dbFName, ctx->tbInfo.suid, &tbCache));
|
||||
if (NULL == tbCache) {
|
||||
taosMemoryFreeClear(*pTableMeta);
|
||||
*pDb = NULL;
|
||||
ctgDebug("stb 0x%" PRIx64 " meta not in cache", ctx->tbInfo.suid);
|
||||
ctgDebug("stb:0x%" PRIx64 ", meta not in cache", ctx->tbInfo.suid);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -592,7 +592,7 @@ int32_t ctgCopyTbMeta(SCatalog *pCtg, SCtgTbMetaCtx *ctx, SCtgDBCache **pDb, SCt
|
|||
|
||||
STableMeta *stbMeta = tbCache->pMeta;
|
||||
if (stbMeta->suid != ctx->tbInfo.suid) {
|
||||
ctgError("stb suid 0x%" PRIx64 " in stbCache mis-match, expected suid 0x%" PRIx64, stbMeta->suid, ctx->tbInfo.suid);
|
||||
ctgError("stb:0x%" PRIx64 ", suid in stbCache mis-match, expected suid:0x%" PRIx64, stbMeta->suid, ctx->tbInfo.suid);
|
||||
taosMemoryFreeClear(*pTableMeta);
|
||||
CTG_ERR_RET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
@ -632,7 +632,7 @@ int32_t ctgReadTbMetaFromCache(SCatalog *pCtg, SCtgTbMetaCtx *ctx, STableMeta **
|
|||
|
||||
ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache);
|
||||
|
||||
ctgDebug("Got tb %s meta from cache, dbFName:%s", ctx->pName->tname, dbFName);
|
||||
ctgDebug("tb:%s, get meta from cache, db:%s", ctx->pName->tname, dbFName);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
||||
|
@ -669,7 +669,7 @@ int32_t ctgReadTbVerFromCache(SCatalog *pCtg, SName *pTableName, int32_t *sver,
|
|||
*sver = tbMeta->sversion;
|
||||
*tver = tbMeta->tversion;
|
||||
|
||||
ctgDebug("Got tb %s ver from cache, dbFName:%s, tbType:%d, sver:%d, tver:%d, suid:0x%" PRIx64, pTableName->tname,
|
||||
ctgDebug("tb:%s, get ver from cache, db:%s, tbType:%d, sver:%d, tver:%d, suid:0x%" PRIx64, pTableName->tname,
|
||||
dbFName, *tbType, *sver, *tver, *suid);
|
||||
|
||||
ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache);
|
||||
|
@ -684,19 +684,19 @@ int32_t ctgReadTbVerFromCache(SCatalog *pCtg, SName *pTableName, int32_t *sver,
|
|||
taosHashRelease(dbCache->tbCache, tbCache);
|
||||
}
|
||||
|
||||
ctgDebug("Got ctb %s ver from cache, will continue to get its stb ver, dbFName:%s", pTableName->tname, dbFName);
|
||||
ctgDebug("ctb:%s, get ver from cache, will continue to get its stb ver, db:%s", pTableName->tname, dbFName);
|
||||
|
||||
CTG_ERR_RET(ctgAcquireStbMetaFromCache(dbCache, pCtg, dbFName, *suid, &tbCache));
|
||||
if (NULL == tbCache) {
|
||||
// ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache);
|
||||
ctgDebug("stb 0x%" PRIx64 " meta not in cache", *suid);
|
||||
ctgDebug("stb:0x%" PRIx64 ", meta not in cache", *suid);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
STableMeta *stbMeta = tbCache->pMeta;
|
||||
if (stbMeta->suid != *suid) {
|
||||
ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache);
|
||||
ctgError("stb suid 0x%" PRIx64 " in stbCache mis-match, expected suid:0x%" PRIx64, stbMeta->suid, *suid);
|
||||
ctgError("stb:0x%" PRIx64 ", suid in stbCache mis-match, expected suid:0x%" PRIx64, stbMeta->suid, *suid);
|
||||
CTG_ERR_RET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
|
@ -711,7 +711,7 @@ int32_t ctgReadTbVerFromCache(SCatalog *pCtg, SName *pTableName, int32_t *sver,
|
|||
|
||||
ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache);
|
||||
|
||||
ctgDebug("Got tb %s sver %d tver %d from cache, type:%d, dbFName:%s", pTableName->tname, *sver, *tver, *tbType,
|
||||
ctgDebug("tb:%s, get sver %d tver %d from cache, type:%d, db:%s", pTableName->tname, *sver, *tver, *tbType,
|
||||
dbFName);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -729,7 +729,7 @@ int32_t ctgReadTbTypeFromCache(SCatalog *pCtg, char *dbFName, char *tbName, int3
|
|||
*tbType = tbCache->pMeta->tableType;
|
||||
ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache);
|
||||
|
||||
ctgDebug("Got tb %s tbType %d from cache, dbFName:%s", tbName, *tbType, dbFName);
|
||||
ctgDebug("tb:%s, get tbType %d from cache, db:%s", tbName, *tbType, dbFName);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -764,7 +764,7 @@ int32_t ctgReadDBCfgFromCache(SCatalog *pCtg, const char* dbFName, SDbCfgInfo* p
|
|||
|
||||
CTG_ERR_RET(ctgAcquireDBCache(pCtg, dbFName, &dbCache));
|
||||
if (NULL == dbCache) {
|
||||
ctgDebug("db %s not in cache", dbFName);
|
||||
ctgTrace("db:%s, db not in cache", dbFName);
|
||||
pDbCfg->cfgVersion = -1;
|
||||
CTG_CACHE_NHIT_INC(CTG_CI_DB_CFG, 1);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -801,13 +801,13 @@ int32_t ctgGetCachedStbNameFromSuid(SCatalog* pCtg, char* dbFName, uint64_t suid
|
|||
SCtgDBCache *dbCache = NULL;
|
||||
CTG_ERR_RET(ctgAcquireDBCache(pCtg, dbFName, &dbCache));
|
||||
if (NULL == dbCache) {
|
||||
ctgDebug("db %s not in cache", dbFName);
|
||||
ctgDebug("stb:0x%" PRIx64 ", db not in cache, db:%s", suid, dbFName);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
char *stb = taosHashAcquire(dbCache->stbCache, &suid, sizeof(suid));
|
||||
if (NULL == stb) {
|
||||
ctgDebug("stb 0x%" PRIx64 " not in cache, dbFName:%s", suid, dbFName);
|
||||
ctgDebug("stb:0x%" PRIx64 ", not in cache, db:%s", suid, dbFName);
|
||||
ctgReleaseDBCache(pCtg, dbCache);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -829,13 +829,13 @@ int32_t ctgChkAuthFromCache(SCatalog *pCtg, SUserAuthInfo *pReq, bool tbNotExist
|
|||
|
||||
SCtgUserAuth *pUser = (SCtgUserAuth *)taosHashGet(pCtg->userCache, pReq->user, strlen(pReq->user));
|
||||
if (NULL == pUser) {
|
||||
ctgDebug("user not in cache, user:%s", pReq->user);
|
||||
ctgDebug("user:%s, user not in cache", pReq->user);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
*inCache = true;
|
||||
|
||||
ctgDebug("Got user from cache, user:%s", pReq->user);
|
||||
ctgDebug("user:%s, get user from cache", pReq->user);
|
||||
CTG_CACHE_HIT_INC(CTG_CI_USER, 1);
|
||||
|
||||
SCtgAuthReq req = {0};
|
||||
|
@ -859,7 +859,7 @@ _return:
|
|||
|
||||
*inCache = false;
|
||||
CTG_CACHE_NHIT_INC(CTG_CI_USER, 1);
|
||||
ctgDebug("Get user from cache failed, user:%s, metaNotExists:%d, code:%d", pReq->user, pRes->metaNotExists, code);
|
||||
ctgDebug("user:%s, get user from cache failed, metaNotExists:%d, code:%d", pReq->user, pRes->metaNotExists, code);
|
||||
|
||||
return code;
|
||||
}
|
||||
|
@ -1714,11 +1714,11 @@ int32_t ctgAddNewDBCache(SCatalog *pCtg, const char *dbFName, uint64_t dbId) {
|
|||
code = taosHashPut(pCtg->dbCache, dbFName, strlen(dbFName), &newDBCache, sizeof(SCtgDBCache));
|
||||
if (code) {
|
||||
if (HASH_NODE_EXIST(code)) {
|
||||
ctgDebug("db already in cache, dbFName:%s", dbFName);
|
||||
ctgDebug("db:%s, db already in cache", dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
ctgError("taosHashPut db to cache failed, dbFName:%s", dbFName);
|
||||
ctgError("db:%s, taosHashPut db to cache failed", dbFName);
|
||||
CTG_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
|
@ -1727,12 +1727,12 @@ int32_t ctgAddNewDBCache(SCatalog *pCtg, const char *dbFName, uint64_t dbId) {
|
|||
SDbCacheInfo dbCacheInfo = {.dbId = newDBCache.dbId, .vgVersion = -1, .stateTs = 0, .cfgVersion = -1, .tsmaVersion = -1};
|
||||
tstrncpy(dbCacheInfo.dbFName, dbFName, sizeof(dbCacheInfo.dbFName));
|
||||
|
||||
ctgDebug("db added to cache, dbFName:%s, dbId:0x%" PRIx64, dbFName, dbId);
|
||||
ctgDebug("db:%s, db added to cache, dbId:0x%" PRIx64, dbFName, dbId);
|
||||
|
||||
if (!IS_SYS_DBNAME(dbFName)) {
|
||||
CTG_ERR_RET(ctgMetaRentAdd(&pCtg->dbRent, &dbCacheInfo, dbId, sizeof(SDbCacheInfo)));
|
||||
|
||||
ctgDebug("db added to rent, dbFName:%s, vgVersion:%d, dbId:0x%" PRIx64, dbFName, dbCacheInfo.vgVersion, dbId);
|
||||
ctgDebug("db:%s, db added to rent, vgVersion:%d, dbId:0x%" PRIx64, dbFName, dbCacheInfo.vgVersion, dbId);
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -1747,7 +1747,7 @@ _return:
|
|||
int32_t ctgRemoveDBFromCache(SCatalog *pCtg, SCtgDBCache *dbCache, const char *dbFName) {
|
||||
uint64_t dbId = dbCache->dbId;
|
||||
|
||||
ctgInfo("start to remove db from cache, dbFName:%s, dbId:0x%" PRIx64, dbFName, dbCache->dbId);
|
||||
ctgInfo("db:%s, start to remove db from cache, dbId:0x%" PRIx64, dbFName, dbCache->dbId);
|
||||
|
||||
CTG_LOCK(CTG_WRITE, &dbCache->dbLock);
|
||||
|
||||
|
@ -1760,15 +1760,15 @@ int32_t ctgRemoveDBFromCache(SCatalog *pCtg, SCtgDBCache *dbCache, const char *d
|
|||
CTG_UNLOCK(CTG_WRITE, &dbCache->dbLock);
|
||||
|
||||
CTG_ERR_RET(ctgMetaRentRemove(&pCtg->dbRent, dbId, ctgDbCacheInfoSortCompare, ctgDbCacheInfoSearchCompare));
|
||||
ctgDebug("db removed from rent, dbFName:%s, dbId:0x%" PRIx64, dbFName, dbId);
|
||||
ctgDebug("db:%s, db removed from rent, dbId:0x%" PRIx64, dbFName, dbId);
|
||||
|
||||
if (taosHashRemove(pCtg->dbCache, dbFName, strlen(dbFName))) {
|
||||
ctgInfo("taosHashRemove from dbCache failed, may be removed, dbFName:%s", dbFName);
|
||||
ctgInfo("db:%s, taosHashRemove from dbCache failed, may be removed", dbFName);
|
||||
CTG_ERR_RET(TSDB_CODE_CTG_DB_DROPPED);
|
||||
}
|
||||
|
||||
CTG_CACHE_NUM_DEC(CTG_CI_DB, 1);
|
||||
ctgInfo("db removed from cache, dbFName:%s, dbId:0x%" PRIx64, dbFName, dbId);
|
||||
ctgInfo("db:%s, db removed from cache, dbId:0x%" PRIx64, dbFName, dbId);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -1842,9 +1842,9 @@ int32_t ctgWriteTbMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
|
|||
if (stbName) {
|
||||
uint64_t metaSize = strlen(stbName) + 1 + sizeof(orig->suid);
|
||||
if (taosHashRemove(dbCache->stbCache, &orig->suid, sizeof(orig->suid))) {
|
||||
ctgError("stb not exist in stbCache, dbFName:%s, stb:%s, suid:0x%" PRIx64, dbFName, tbName, orig->suid);
|
||||
ctgError("stb not exist in stbCache, db:%s, stb:%s, suid:0x%" PRIx64, dbFName, tbName, orig->suid);
|
||||
} else {
|
||||
ctgDebug("stb removed from stbCache, dbFName:%s, stb:%s, suid:0x%" PRIx64, dbFName, tbName, orig->suid);
|
||||
ctgDebug("stb removed from stbCache, db:%s, stb:%s, suid:0x%" PRIx64, dbFName, tbName, orig->suid);
|
||||
(void)atomic_sub_fetch_64(&dbCache->dbCacheSize, metaSize);
|
||||
}
|
||||
}
|
||||
|
@ -1855,7 +1855,7 @@ int32_t ctgWriteTbMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
|
|||
SCtgTbCache cache = {0};
|
||||
cache.pMeta = meta;
|
||||
if (taosHashPut(dbCache->tbCache, tbName, strlen(tbName), &cache, sizeof(SCtgTbCache)) != 0) {
|
||||
ctgError("taosHashPut new tbCache failed, dbFName:%s, tbName:%s, tbType:%d", dbFName, tbName, meta->tableType);
|
||||
ctgError("taosHashPut new tbCache failed, db:%s, tbName:%s, tbType:%d", dbFName, tbName, meta->tableType);
|
||||
taosMemoryFree(meta);
|
||||
CTG_ERR_RET(terrno);
|
||||
}
|
||||
|
@ -1882,7 +1882,7 @@ int32_t ctgWriteTbMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
|
|||
|
||||
CTG_META_NUM_INC(pCache->pMeta->tableType);
|
||||
|
||||
ctgDebug("tbmeta updated to cache, dbFName:%s, tbName:%s, tbType:%d", dbFName, tbName, meta->tableType);
|
||||
ctgDebug("tbmeta updated to cache, db:%s, tbName:%s, tbType:%d", dbFName, tbName, meta->tableType);
|
||||
ctgdShowTableMeta(pCtg, tbName, meta);
|
||||
|
||||
if (!isStb) {
|
||||
|
@ -1896,7 +1896,7 @@ int32_t ctgWriteTbMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
|
|||
|
||||
(void)atomic_add_fetch_64(&dbCache->dbCacheSize, sizeof(meta->suid) + strlen(tbName) + 1);
|
||||
|
||||
ctgDebug("stb 0x%" PRIx64 " updated to cache, dbFName:%s, tbName:%s, tbType:%d", meta->suid, dbFName, tbName,
|
||||
ctgDebug("stb:0x%" PRIx64 ", updated to cache, db:%s, tbName:%s, tbType:%d", meta->suid, dbFName, tbName,
|
||||
meta->tableType);
|
||||
|
||||
CTG_ERR_RET(ctgUpdateRentStbVersion(pCtg, dbFName, tbName, dbId, meta->suid, pCache));
|
||||
|
@ -2121,14 +2121,14 @@ int32_t ctgWriteTbTSMAToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
|
|||
}
|
||||
|
||||
if (taosHashPut(dbCache->tsmaCache, tbName, strlen(tbName), &cache, sizeof(cache))) {
|
||||
ctgError("taosHashPut new tsmacache for tb: %s.%s failed", dbFName, tbName);
|
||||
ctgError("tb:%s.%s, taosHashPut new tsmacache for tb failed", dbFName, tbName);
|
||||
CTG_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
(void)atomic_add_fetch_64(&dbCache->dbCacheSize, strlen(tbName) + sizeof(STSMACache) + ctgGetTbTSMACacheSize(pTsmaCache));
|
||||
|
||||
CTG_DB_NUM_INC(CTG_CI_TBL_TSMA);
|
||||
ctgDebug("tb %s tsma updated to cache, name: %s", tbName, pTsmaCache->name);
|
||||
ctgDebug("tb:%s, tsma updated to cache, name:%s", tbName, pTsmaCache->name);
|
||||
|
||||
CTG_ERR_JRET(ctgUpdateRentTSMAVersion(pCtg, dbFName, pTsmaCache));
|
||||
*ppTsmaCache = NULL;
|
||||
|
@ -2148,7 +2148,7 @@ int32_t ctgWriteTbTSMAToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
|
|||
}
|
||||
|
||||
if (pInfo->tsmaId == pTsmaCache->tsmaId) {
|
||||
ctgDebug("tsma: %s removed from cache, history from %d to %d, reqTs from %" PRId64 " to %" PRId64
|
||||
ctgDebug("tsma:%s, removed from cache, history from %d to %d, reqTs from %" PRId64 " to %" PRId64
|
||||
"rspTs from %" PRId64 " to %" PRId64 " delay from %" PRId64 " to %" PRId64,
|
||||
pInfo->name, pInfo->fillHistoryFinished, pTsmaCache->fillHistoryFinished, pInfo->reqTs,
|
||||
pTsmaCache->reqTs, pInfo->rspTs, pTsmaCache->rspTs, pInfo->delayDuration, pTsmaCache->delayDuration);
|
||||
|
@ -2181,7 +2181,7 @@ int32_t ctgWriteTbTSMAToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
|
|||
|
||||
CTG_ERR_RET(ctgUpdateRentTSMAVersion(pCtg, dbFName, pTsmaCache));
|
||||
|
||||
ctgDebug("table %s tsma updated to cache, tsma: %s", tbName, pTsmaCache->name);
|
||||
ctgDebug("tb:%s, tsma updated to cache, tsma:%s", tbName, pTsmaCache->name);
|
||||
}
|
||||
|
||||
CTG_UNLOCK(CTG_WRITE, &pCache->tsmaLock);
|
||||
|
@ -2204,7 +2204,7 @@ int32_t ctgOpUpdateVgroup(SCtgCacheOperation *operation) {
|
|||
}
|
||||
|
||||
if (dbInfo->vgVersion < 0 || (taosHashGetSize(dbInfo->vgHash) <= 0 && !IS_SYS_DBNAME(dbFName))) {
|
||||
ctgDebug("invalid db vgInfo, dbFName:%s, vgHash:%p, vgVersion:%d, vgHashSize:%d", dbFName, dbInfo->vgHash,
|
||||
ctgDebug("invalid db vgInfo, db:%s, vgHash:%p, vgVersion:%d, vgHashSize:%d", dbFName, dbInfo->vgHash,
|
||||
dbInfo->vgVersion, taosHashGetSize(dbInfo->vgHash));
|
||||
CTG_ERR_JRET(TSDB_CODE_APP_ERROR);
|
||||
}
|
||||
|
@ -2216,7 +2216,7 @@ int32_t ctgOpUpdateVgroup(SCtgCacheOperation *operation) {
|
|||
SCtgDBCache *dbCache = NULL;
|
||||
CTG_ERR_JRET(ctgGetAddDBCache(msg->pCtg, dbFName, msg->dbId, &dbCache));
|
||||
if (NULL == dbCache) {
|
||||
ctgInfo("conflict db update, ignore this update, dbFName:%s, dbId:0x%" PRIx64, dbFName, msg->dbId);
|
||||
ctgInfo("conflict db update, ignore this update, db:%s, dbId:0x%" PRIx64, dbFName, msg->dbId);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
|
@ -2228,7 +2228,7 @@ int32_t ctgOpUpdateVgroup(SCtgCacheOperation *operation) {
|
|||
SDBVgInfo *vgInfo = vgCache->vgInfo;
|
||||
|
||||
if (dbInfo->vgVersion < vgInfo->vgVersion) {
|
||||
ctgDebug("db updateVgroup is ignored, dbFName:%s, vgVer:%d, curVer:%d", dbFName, dbInfo->vgVersion,
|
||||
ctgDebug("db updateVgroup is ignored, db:%s, vgVer:%d, curVer:%d", dbFName, dbInfo->vgVersion,
|
||||
vgInfo->vgVersion);
|
||||
ctgWUnlockVgInfo(dbCache);
|
||||
|
||||
|
@ -2237,7 +2237,7 @@ int32_t ctgOpUpdateVgroup(SCtgCacheOperation *operation) {
|
|||
|
||||
if (dbInfo->vgVersion == vgInfo->vgVersion && dbInfo->numOfTable == vgInfo->numOfTable &&
|
||||
dbInfo->stateTs == vgInfo->stateTs) {
|
||||
ctgDebug("no new db vgroup update info, dbFName:%s, vgVer:%d, numOfTable:%d, stateTs:%" PRId64, dbFName,
|
||||
ctgDebug("no new db vgroup update info, db:%s, vgVer:%d, numOfTable:%d, stateTs:%" PRId64, dbFName,
|
||||
dbInfo->vgVersion, dbInfo->numOfTable, dbInfo->stateTs);
|
||||
ctgWUnlockVgInfo(dbCache);
|
||||
|
||||
|
@ -2245,7 +2245,7 @@ int32_t ctgOpUpdateVgroup(SCtgCacheOperation *operation) {
|
|||
}
|
||||
|
||||
uint64_t groupCacheSize = ctgGetDbVgroupCacheSize(vgCache->vgInfo);
|
||||
ctgDebug("sub dbGroupCacheSize %" PRIu64 " from db, dbFName:%s", groupCacheSize, dbFName);
|
||||
ctgDebug("sub dbGroupCacheSize %" PRIu64 " from db, db:%s", groupCacheSize, dbFName);
|
||||
|
||||
(void)atomic_sub_fetch_64(&dbCache->dbCacheSize, groupCacheSize);
|
||||
|
||||
|
@ -2262,14 +2262,14 @@ int32_t ctgOpUpdateVgroup(SCtgCacheOperation *operation) {
|
|||
msg->dbInfo = NULL;
|
||||
CTG_DB_NUM_SET(CTG_CI_DB_VGROUP);
|
||||
|
||||
ctgDebug("db vgInfo updated, dbFName:%s, vgVer:%d, stateTs:%" PRId64 ", dbId:0x%" PRIx64, dbFName,
|
||||
ctgDebug("db:%s, db vgInfo updated, vgVer:%d, stateTs:%" PRId64 ", dbId:0x%" PRIx64, dbFName,
|
||||
dbCacheInfo.vgVersion, dbCacheInfo.stateTs, dbCacheInfo.dbId);
|
||||
|
||||
ctgWUnlockVgInfo(dbCache);
|
||||
|
||||
uint64_t groupCacheSize = ctgGetDbVgroupCacheSize(vgCache->vgInfo);
|
||||
(void)atomic_add_fetch_64(&dbCache->dbCacheSize, groupCacheSize);
|
||||
ctgDebug("add dbGroupCacheSize %" PRIu64 " from db, dbFName:%s", groupCacheSize, dbFName);
|
||||
ctgDebug("db:%s, add dbGroupCacheSize:%" PRIu64 " from db", dbFName, groupCacheSize);
|
||||
|
||||
dbCache = NULL;
|
||||
|
||||
|
@ -2299,14 +2299,14 @@ int32_t ctgOpUpdateDbCfg(SCtgCacheOperation *operation) {
|
|||
}
|
||||
|
||||
if (cfgInfo->cfgVersion < 0) {
|
||||
ctgDebug("invalid db cfgInfo, dbFName:%s, cfgVersion:%d", dbFName, cfgInfo->cfgVersion);
|
||||
ctgDebug("invalid db cfgInfo, db:%s, cfgVersion:%d", dbFName, cfgInfo->cfgVersion);
|
||||
CTG_ERR_JRET(TSDB_CODE_APP_ERROR);
|
||||
}
|
||||
|
||||
SCtgDBCache *dbCache = NULL;
|
||||
CTG_ERR_JRET(ctgGetAddDBCache(msg->pCtg, dbFName, msg->dbId, &dbCache));
|
||||
if (NULL == dbCache) {
|
||||
ctgInfo("conflict db update, ignore this update, dbFName:%s, dbId:0x%" PRIx64, dbFName, msg->dbId);
|
||||
ctgInfo("conflict db update, ignore this update, db:%s, dbId:0x%" PRIx64, dbFName, msg->dbId);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
|
@ -2333,7 +2333,7 @@ int32_t ctgOpUpdateDbCfg(SCtgCacheOperation *operation) {
|
|||
|
||||
ctgWUnlockDbCfgInfo(dbCache);
|
||||
|
||||
ctgDebug("db cfgInfo updated, dbFName:%s, cfgVer:%d", dbFName, dbCache->cfgCache.cfgInfo->cfgVersion);
|
||||
ctgDebug("db:%s, db cfgInfo updated, cfgVer:%d", dbFName, dbCache->cfgCache.cfgInfo->cfgVersion);
|
||||
|
||||
// if (!IS_SYS_DBNAME(dbFName)) {
|
||||
CTG_ERR_JRET(ctgMetaRentUpdate(&msg->pCtg->dbRent, &cacheInfo, cacheInfo.dbId, sizeof(SDbCacheInfo),
|
||||
|
@ -2365,7 +2365,7 @@ int32_t ctgOpDropDbCache(SCtgCacheOperation *operation) {
|
|||
}
|
||||
|
||||
if (msg->dbId && dbCache->dbId != msg->dbId) {
|
||||
ctgInfo("dbId already updated, dbFName:%s, dbId:0x%" PRIx64 ", targetId:0x%" PRIx64, msg->dbFName, dbCache->dbId,
|
||||
ctgInfo("db:%s, dbId already updated, dbId:0x%" PRIx64 ", targetId:0x%" PRIx64, msg->dbFName, dbCache->dbId,
|
||||
msg->dbId);
|
||||
goto _return;
|
||||
}
|
||||
|
@ -2402,7 +2402,7 @@ int32_t ctgOpDropDbVgroup(SCtgCacheOperation *operation) {
|
|||
dbCache->vgCache.vgInfo = NULL;
|
||||
|
||||
CTG_DB_NUM_RESET(CTG_CI_DB_VGROUP);
|
||||
ctgDebug("db vgInfo removed, dbFName:%s", msg->dbFName);
|
||||
ctgDebug("db:%s, db vgInfo removed", msg->dbFName);
|
||||
|
||||
ctgWUnlockVgInfo(dbCache);
|
||||
|
||||
|
@ -2425,7 +2425,7 @@ int32_t ctgOpUpdateTbMeta(SCtgCacheOperation *operation) {
|
|||
}
|
||||
|
||||
if ((!CTG_IS_META_CTABLE(pMeta->metaType)) && NULL == pMeta->tbMeta) {
|
||||
ctgError("no valid tbmeta got from meta rsp, dbFName:%s, tbName:%s", pMeta->dbFName, pMeta->tbName);
|
||||
ctgError("no valid tbmeta got from meta rsp, db:%s, tbName:%s", pMeta->dbFName, pMeta->tbName);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
|
@ -2436,7 +2436,7 @@ int32_t ctgOpUpdateTbMeta(SCtgCacheOperation *operation) {
|
|||
|
||||
CTG_ERR_JRET(ctgGetAddDBCache(pCtg, pMeta->dbFName, pMeta->dbId, &dbCache));
|
||||
if (NULL == dbCache) {
|
||||
ctgInfo("conflict db update, ignore this update, dbFName:%s, dbId:0x%" PRIx64, pMeta->dbFName, pMeta->dbId);
|
||||
ctgInfo("db:%s, conflict db update, ignore this update, dbId:0x%" PRIx64, pMeta->dbFName, pMeta->dbId);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
|
@ -2483,8 +2483,8 @@ int32_t ctgOpDropStbMeta(SCtgCacheOperation *operation) {
|
|||
}
|
||||
|
||||
if ((0 != msg->dbId) && (dbCache->dbId != msg->dbId)) {
|
||||
ctgDebug("dbId already modified, dbFName:%s, current:0x%" PRIx64 ", dbId:0x%" PRIx64 ", stb:%s, suid:0x%" PRIx64,
|
||||
msg->dbFName, dbCache->dbId, msg->dbId, msg->stbName, msg->suid);
|
||||
ctgDebug("stb:%s, dbId already modified, current:0x%" PRIx64 ", dbId:0x%" PRIx64 ", db:%s, suid:0x%" PRIx64,
|
||||
msg->stbName, dbCache->dbId, msg->dbId, msg->dbFName, msg->suid);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
|
@ -2492,8 +2492,8 @@ int32_t ctgOpDropStbMeta(SCtgCacheOperation *operation) {
|
|||
if (stbName) {
|
||||
uint64_t metaSize = strlen(stbName) + 1 + sizeof(msg->suid);
|
||||
if (taosHashRemove(dbCache->stbCache, &msg->suid, sizeof(msg->suid))) {
|
||||
ctgDebug("stb not exist in stbCache, may be removed, dbFName:%s, stb:%s, suid:0x%" PRIx64, msg->dbFName,
|
||||
msg->stbName, msg->suid);
|
||||
ctgDebug("stb:%s, stb not exist in stbCache, may be removed, db:%s, suid:0x%" PRIx64, msg->stbName, msg->dbFName,
|
||||
msg->suid);
|
||||
} else {
|
||||
(void)atomic_sub_fetch_64(&dbCache->dbCacheSize, metaSize);
|
||||
}
|
||||
|
@ -2501,7 +2501,7 @@ int32_t ctgOpDropStbMeta(SCtgCacheOperation *operation) {
|
|||
|
||||
SCtgTbCache *pTbCache = taosHashGet(dbCache->tbCache, msg->stbName, strlen(msg->stbName));
|
||||
if (NULL == pTbCache) {
|
||||
ctgDebug("stb %s already not in cache", msg->stbName);
|
||||
ctgDebug("stb:%s, already not in cache", msg->stbName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
|
@ -2511,17 +2511,17 @@ int32_t ctgOpDropStbMeta(SCtgCacheOperation *operation) {
|
|||
ctgFreeTbCacheImpl(pTbCache, true);
|
||||
|
||||
if (taosHashRemove(dbCache->tbCache, msg->stbName, strlen(msg->stbName))) {
|
||||
ctgError("stb not exist in cache, dbFName:%s, stb:%s, suid:0x%" PRIx64, msg->dbFName, msg->stbName, msg->suid);
|
||||
ctgError("stb:%s, stb not exist in cache, db:%s, suid:0x%" PRIx64, msg->stbName, msg->dbFName, msg->suid);
|
||||
} else {
|
||||
CTG_META_NUM_DEC(tblType);
|
||||
(void)atomic_sub_fetch_64(&dbCache->dbCacheSize, sizeof(*pTbCache) + strlen(msg->stbName));
|
||||
}
|
||||
|
||||
ctgInfo("stb removed from cache, dbFName:%s, stbName:%s, suid:0x%" PRIx64, msg->dbFName, msg->stbName, msg->suid);
|
||||
ctgInfo("stb:%s, stb removed from cache, db:%s, suid:0x%" PRIx64, msg->stbName, msg->dbFName, msg->suid);
|
||||
|
||||
CTG_ERR_JRET(ctgMetaRentRemove(&msg->pCtg->stbRent, msg->suid, ctgStbVersionSortCompare, ctgStbVersionSearchCompare));
|
||||
|
||||
ctgDebug("stb removed from rent, dbFName:%s, stbName:%s, suid:0x%" PRIx64, msg->dbFName, msg->stbName, msg->suid);
|
||||
ctgDebug("stb:%s, stb removed from rent, db:%s, suid:0x%" PRIx64, msg->stbName, msg->dbFName, msg->suid);
|
||||
|
||||
_return:
|
||||
|
||||
|
@ -2547,14 +2547,14 @@ int32_t ctgOpDropTbMeta(SCtgCacheOperation *operation) {
|
|||
}
|
||||
|
||||
if ((0 != msg->dbId) && (dbCache->dbId != msg->dbId)) {
|
||||
ctgDebug("dbId 0x%" PRIx64 " not match with curId 0x%" PRIx64 ", dbFName:%s, tbName:%s", msg->dbId, dbCache->dbId,
|
||||
msg->dbFName, msg->tbName);
|
||||
ctgDebug("tb:%s, dbId:0x%" PRIx64 " not match with curId:0x%" PRIx64 ", db:%s", msg->tbName, msg->dbId,
|
||||
dbCache->dbId, msg->dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
SCtgTbCache *pTbCache = taosHashGet(dbCache->tbCache, msg->tbName, strlen(msg->tbName));
|
||||
if (NULL == pTbCache) {
|
||||
ctgDebug("tb %s already not in cache", msg->tbName);
|
||||
ctgDebug("tb:%s, already not in cache", msg->tbName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
|
@ -2564,14 +2564,14 @@ int32_t ctgOpDropTbMeta(SCtgCacheOperation *operation) {
|
|||
ctgFreeTbCacheImpl(pTbCache, true);
|
||||
|
||||
if (taosHashRemove(dbCache->tbCache, msg->tbName, strlen(msg->tbName))) {
|
||||
ctgError("tb %s not exist in cache, dbFName:%s", msg->tbName, msg->dbFName);
|
||||
ctgError("tb:%s, not exist in cache, db:%s", msg->tbName, msg->dbFName);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
} else {
|
||||
(void)atomic_sub_fetch_64(&dbCache->dbCacheSize, sizeof(*pTbCache) + strlen(msg->tbName));
|
||||
CTG_META_NUM_DEC(tblType);
|
||||
}
|
||||
|
||||
ctgDebug("table %s removed from cache, dbFName:%s", msg->tbName, msg->dbFName);
|
||||
ctgDebug("tb:%s, removed from cache, db:%s", msg->tbName, msg->dbFName);
|
||||
|
||||
_return:
|
||||
|
||||
|
@ -2703,7 +2703,7 @@ int32_t ctgOpUpdateEpset(SCtgCacheOperation *operation) {
|
|||
|
||||
SEp *pOrigEp = &pInfo->epSet.eps[pInfo->epSet.inUse];
|
||||
SEp *pNewEp = &msg->epSet.eps[msg->epSet.inUse];
|
||||
ctgDebug("vgroup %d epset updated from %d/%d=>%s:%d to %d/%d=>%s:%d, dbFName:%s in ctg", pInfo->vgId,
|
||||
ctgDebug("vgroup %d epset updated from %d/%d=>%s:%d to %d/%d=>%s:%d, db:%s in ctg", pInfo->vgId,
|
||||
pInfo->epSet.inUse, pInfo->epSet.numOfEps, pOrigEp->fqdn, pOrigEp->port, msg->epSet.inUse,
|
||||
msg->epSet.numOfEps, pNewEp->fqdn, pNewEp->port, msg->dbFName);
|
||||
|
||||
|
@ -2802,7 +2802,7 @@ int32_t ctgOpUpdateViewMeta(SCtgCacheOperation *operation) {
|
|||
|
||||
CTG_ERR_JRET(ctgGetAddDBCache(pCtg, pRsp->dbFName, pRsp->dbId, &dbCache));
|
||||
if (NULL == dbCache) {
|
||||
ctgInfo("conflict db update, ignore this update, dbFName:%s, dbId:0x%" PRIx64, pRsp->dbFName, pRsp->dbId);
|
||||
ctgInfo("db:%s, conflict db update, ignore this update, dbId:0x%" PRIx64, pRsp->dbFName, pRsp->dbId);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
|
@ -2843,39 +2843,39 @@ int32_t ctgOpDropViewMeta(SCtgCacheOperation *operation) {
|
|||
}
|
||||
|
||||
if ((0 != msg->dbId) && (dbCache->dbId != msg->dbId)) {
|
||||
ctgDebug("dbId 0x%" PRIx64 " not match with curId 0x%" PRIx64 ", dbFName:%s, viewName:%s", msg->dbId, dbCache->dbId,
|
||||
msg->dbFName, msg->viewName);
|
||||
ctgDebug("view:%s, dbId:0x%" PRIx64 " not match with curId:0x%" PRIx64 ", db:%s", msg->viewName, msg->dbId,
|
||||
dbCache->dbId, msg->dbFName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
SCtgViewCache *pViewCache = taosHashGet(dbCache->viewCache, msg->viewName, strlen(msg->viewName));
|
||||
if (NULL == pViewCache) {
|
||||
ctgDebug("view %s already not in cache", msg->viewName);
|
||||
ctgDebug("view:%s, already not in cache", msg->viewName);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
int64_t viewId = pViewCache->pMeta->viewId;
|
||||
if (0 != msg->viewId && viewId != msg->viewId) {
|
||||
ctgDebug("viewId 0x%" PRIx64 " not match with curId 0x%" PRIx64 ", viewName:%s", msg->viewId, viewId, msg->viewName);
|
||||
ctgDebug("view:%s, viewId:0x%" PRIx64 " not match with curId:0x%" PRIx64, msg->viewName, msg->viewId, viewId);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
|
||||
(void)atomic_sub_fetch_64(&dbCache->dbCacheSize, ctgGetViewMetaCacheSize(pViewCache->pMeta));
|
||||
ctgFreeViewCacheImpl(pViewCache, true);
|
||||
|
||||
if (taosHashRemove(dbCache->viewCache, msg->viewName, strlen(msg->viewName))) {
|
||||
ctgError("view %s not exist in cache, dbFName:%s", msg->viewName, msg->dbFName);
|
||||
ctgError("view:%s, not exist in cache, db:%s", msg->viewName, msg->dbFName);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
} else {
|
||||
(void)atomic_sub_fetch_64(&dbCache->dbCacheSize, sizeof(SCtgViewCache) + strlen(msg->viewName));
|
||||
CTG_DB_NUM_DEC(CTG_CI_VIEW);
|
||||
}
|
||||
|
||||
ctgDebug("view %s removed from cache, dbFName:%s", msg->viewName, msg->dbFName);
|
||||
ctgDebug("view:%s, removed from cache, db:%s", msg->viewName, msg->dbFName);
|
||||
|
||||
CTG_ERR_JRET(ctgMetaRentRemove(&msg->pCtg->viewRent, viewId, ctgViewVersionSortCompare, ctgViewVersionSearchCompare));
|
||||
|
||||
ctgDebug("view %s removed from rent, dbFName:%s, viewId:0x%" PRIx64, msg->viewName, msg->dbFName, viewId);
|
||||
ctgDebug("view:%s, removed from rent, db:%s, viewId:0x%" PRIx64, msg->viewName, msg->dbFName, viewId);
|
||||
|
||||
_return:
|
||||
|
||||
|
@ -3011,10 +3011,10 @@ int32_t ctgOpDropTbTSMA(SCtgCacheOperation *operation) {
|
|||
pCtgCache->pTsmas = NULL;
|
||||
pCtgCache->retryFetch = true;
|
||||
|
||||
ctgDebug("all tsmas for table dropped: %s.%s", msg->dbFName, msg->tbName);
|
||||
ctgDebug("tb:%s.%s, all tsmas for table dropped", msg->dbFName, msg->tbName);
|
||||
code = taosHashRemove(dbCache->tsmaCache, msg->tbName, TSDB_TABLE_NAME_LEN);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
ctgError("remove table %s.%s from tsmaCache failed, error:%s", msg->dbFName, msg->tbName, tstrerror(code));
|
||||
ctgError("tb:%s.%s, remove from tsmaCache failed, error:%s", msg->dbFName, msg->tbName, tstrerror(code));
|
||||
}
|
||||
|
||||
CTG_UNLOCK(CTG_WRITE, &pCtgCache->tsmaLock);
|
||||
|
@ -3432,7 +3432,7 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
|
|||
CTG_ERR_RET(ctgAcquireDBCache(pCtg, dbFName, &dbCache));
|
||||
|
||||
if (NULL == dbCache) {
|
||||
ctgDebug("db %s not in cache", dbFName);
|
||||
ctgTrace("db:%s, db not in cache", dbFName);
|
||||
for (int32_t i = 0; i < tbNum; ++i) {
|
||||
CTG_ERR_JRET(ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag));
|
||||
if (NULL == taosArrayPush(ctx->pResList, &(SMetaData){0})) {
|
||||
|
@ -3452,7 +3452,7 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
|
|||
|
||||
pCache = taosHashAcquire(dbCache->tbCache, pName->tname, strlen(pName->tname));
|
||||
if (NULL == pCache) {
|
||||
ctgDebug("tb %s not in cache, dbFName:%s", pName->tname, dbFName);
|
||||
ctgDebug("tb:%s, tb not in cache, db:%s", pName->tname, dbFName);
|
||||
CTG_ERR_JRET(ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag));
|
||||
if (NULL == taosArrayPush(ctx->pResList, &(SMetaData){0})) {
|
||||
CTG_ERR_JRET(terrno);
|
||||
|
@ -3468,7 +3468,7 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
|
|||
CTG_UNLOCK(CTG_READ, &pCache->metaLock);
|
||||
taosHashRelease(dbCache->tbCache, pCache);
|
||||
|
||||
ctgDebug("tb %s meta not in cache, dbFName:%s", pName->tname, dbFName);
|
||||
ctgDebug("tb:%s, meta not in cache, db:%s", pName->tname, dbFName);
|
||||
|
||||
CTG_ERR_JRET(ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag));
|
||||
if (NULL == taosArrayPush(ctx->pResList, &(SMetaData){0})) {
|
||||
|
@ -3517,7 +3517,7 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
|
|||
CTG_UNLOCK(CTG_READ, &pCache->metaLock);
|
||||
taosHashRelease(dbCache->tbCache, pCache);
|
||||
|
||||
ctgDebug("Got tb %s meta from cache, type:%d, dbFName:%s", pName->tname, pTableMeta->tableType, dbFName);
|
||||
ctgDebug("tb:%s, get meta from cache, type:%d, db:%s", pName->tname, pTableMeta->tableType, dbFName);
|
||||
|
||||
res.pRes = pTableMeta;
|
||||
if (NULL == taosArrayPush(ctx->pResList, &res)) {
|
||||
|
@ -3542,7 +3542,7 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
|
|||
CTG_UNLOCK(CTG_READ, &pCache->metaLock);
|
||||
taosHashRelease(dbCache->tbCache, pCache);
|
||||
|
||||
ctgDebug("Got tb %s meta from cache, type:%d, dbFName:%s", pName->tname, pTableMeta->tableType, dbFName);
|
||||
ctgDebug("tb:%s, get meta from cache, type:%d, db:%s", pName->tname, pTableMeta->tableType, dbFName);
|
||||
|
||||
res.pRes = pTableMeta;
|
||||
if (NULL == taosArrayPush(ctx->pResList, &res)) {
|
||||
|
@ -3564,12 +3564,12 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
|
|||
CTG_UNLOCK(CTG_READ, &pCache->metaLock);
|
||||
taosHashRelease(dbCache->tbCache, pCache);
|
||||
|
||||
ctgDebug("Got ctb %s meta from cache, will continue to get its stb meta, type:%d, dbFName:%s", pName->tname,
|
||||
ctgDebug("ctb:%s, get meta from cache, will continue to get its stb meta, type:%d, db:%s", pName->tname,
|
||||
nctx.tbInfo.tbType, dbFName);
|
||||
|
||||
char *stName = taosHashAcquire(dbCache->stbCache, &pTableMeta->suid, sizeof(pTableMeta->suid));
|
||||
if (NULL == stName) {
|
||||
ctgDebug("stb 0x%" PRIx64 " not in cache, dbFName:%s", pTableMeta->suid, dbFName);
|
||||
ctgDebug("stb:0x%" PRIx64 ", not in cache, db:%s", pTableMeta->suid, dbFName);
|
||||
CTG_ERR_JRET(ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag));
|
||||
if (NULL == taosArrayPush(ctx->pResList, &(SMetaRes){0})) {
|
||||
CTG_ERR_JRET(terrno);
|
||||
|
@ -3582,7 +3582,7 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
|
|||
|
||||
pCache = taosHashAcquire(dbCache->tbCache, stName, strlen(stName));
|
||||
if (NULL == pCache) {
|
||||
ctgDebug("stb 0x%" PRIx64 " name %s not in cache, dbFName:%s", pTableMeta->suid, stName, dbFName);
|
||||
ctgDebug("stb:0x%" PRIx64 ", name:%s not in cache, db:%s", pTableMeta->suid, stName, dbFName);
|
||||
taosHashRelease(dbCache->stbCache, stName);
|
||||
|
||||
CTG_ERR_JRET(ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag));
|
||||
|
@ -3600,7 +3600,7 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
|
|||
|
||||
CTG_LOCK(CTG_READ, &pCache->metaLock);
|
||||
if (NULL == pCache->pMeta) {
|
||||
ctgDebug("stb 0x%" PRIx64 " meta not in cache, dbFName:%s", pTableMeta->suid, dbFName);
|
||||
ctgDebug("stb:0x%" PRIx64 ", meta not in cache, db:%s", pTableMeta->suid, dbFName);
|
||||
CTG_UNLOCK(CTG_READ, &pCache->metaLock);
|
||||
taosHashRelease(dbCache->tbCache, pCache);
|
||||
|
||||
|
@ -3620,7 +3620,7 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
|
|||
CTG_UNLOCK(CTG_READ, &pCache->metaLock);
|
||||
taosHashRelease(dbCache->tbCache, pCache);
|
||||
|
||||
ctgError("stb suid 0x%" PRIx64 " in stbCache mis-match, expected suid 0x%" PRIx64, stbMeta->suid,
|
||||
ctgError("stb:0x%" PRIx64 ", suid in stbCache mis-match, expected suid:0x%" PRIx64, stbMeta->suid,
|
||||
nctx.tbInfo.suid);
|
||||
|
||||
CTG_ERR_JRET(ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag));
|
||||
|
@ -3725,7 +3725,7 @@ int32_t ctgGetTbNamesFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbNa
|
|||
(void)tNameGetFullDbName(pName, dbFName);
|
||||
}
|
||||
|
||||
ctgDebug("db %s not in cache", dbFName);
|
||||
ctgDebug("db:%s, not in cache", dbFName);
|
||||
for (int32_t i = 0; i < tbNum; ++i) {
|
||||
CTG_ERR_JRET(ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag));
|
||||
if (NULL == taosArrayPush(ctx->pResList, &(SMetaData){0})) {
|
||||
|
@ -3801,7 +3801,7 @@ int32_t ctgGetViewsFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgViewsC
|
|||
CTG_ERR_RET(ctgAcquireDBCache(pCtg, dbFName, &dbCache));
|
||||
|
||||
if (NULL == dbCache) {
|
||||
ctgDebug("db %s not in cache", dbFName);
|
||||
ctgDebug("db:%s, not in cache", dbFName);
|
||||
for (int32_t i = 0; i < tbNum; ++i) {
|
||||
CTG_ERR_RET(ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag));
|
||||
if (NULL == taosArrayPush(ctx->pResList, &(SMetaData){0})) {
|
||||
|
@ -3821,7 +3821,7 @@ int32_t ctgGetViewsFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgViewsC
|
|||
|
||||
pCache = taosHashAcquire(dbCache->viewCache, pName->tname, strlen(pName->tname));
|
||||
if (NULL == pCache) {
|
||||
ctgDebug("view %s not in cache, dbFName:%s", pName->tname, dbFName);
|
||||
ctgDebug("view:%s, view not in cache, db:%s", pName->tname, dbFName);
|
||||
CTG_ERR_JRET(ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag));
|
||||
if (NULL == taosArrayPush(ctx->pResList, &(SMetaRes){0})) {
|
||||
CTG_ERR_JRET(terrno);
|
||||
|
@ -3835,7 +3835,7 @@ int32_t ctgGetViewsFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgViewsC
|
|||
if (NULL == pCache->pMeta) {
|
||||
CTG_UNLOCK(CTG_READ, &pCache->viewLock);
|
||||
taosHashRelease(dbCache->viewCache, pCache);
|
||||
ctgDebug("view %s meta not in cache, dbFName:%s", pName->tname, dbFName);
|
||||
ctgDebug("view:%s, meta not in cache, db:%s", pName->tname, dbFName);
|
||||
CTG_ERR_JRET(ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag));
|
||||
if (NULL == taosArrayPush(ctx->pResList, &(SMetaRes){0})) {
|
||||
CTG_ERR_JRET(terrno);
|
||||
|
@ -3877,7 +3877,7 @@ int32_t ctgGetViewsFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgViewsC
|
|||
CTG_UNLOCK(CTG_READ, &pCache->viewLock);
|
||||
taosHashRelease(dbCache->viewCache, pCache);
|
||||
|
||||
ctgDebug("Got view %s meta from cache, dbFName:%s", pName->tname, dbFName);
|
||||
ctgDebug("view:%s, get meta from cache, db:%s", pName->tname, dbFName);
|
||||
|
||||
res.pRes = pViewMeta;
|
||||
if (NULL == taosArrayPush(ctx->pResList, &res)) {
|
||||
|
@ -3917,7 +3917,7 @@ int32_t ctgGetTbTSMAFromCache(SCatalog* pCtg, SCtgTbTSMACtx* pCtx, int32_t dbIdx
|
|||
// get db cache
|
||||
CTG_ERR_RET(ctgAcquireDBCache(pCtg, dbFName, &dbCache));
|
||||
if (!dbCache) {
|
||||
ctgDebug("DB %s not in cache", dbFName);
|
||||
ctgTrace("db:%s, db not in cache", dbFName);
|
||||
for (int32_t i = 0; i < tbNum; ++i) {
|
||||
CTG_ERR_RET(ctgAddTSMAFetch(&pCtx->pFetches, dbIdx, i, fetchIdx, baseResIdx + i, flag, FETCH_TSMA_SOURCE_TB_META, NULL));
|
||||
if (NULL == taosArrayPush(pCtx->pResList, &(SMetaData){0})) {
|
||||
|
@ -3938,7 +3938,7 @@ int32_t ctgGetTbTSMAFromCache(SCatalog* pCtg, SCtgTbTSMACtx* pCtx, int32_t dbIdx
|
|||
|
||||
pTbCache = taosHashAcquire(dbCache->tbCache, pName->tname, strlen(pName->tname));
|
||||
if (!pTbCache) {
|
||||
ctgDebug("tb: %s.%s not in cache", dbFName, pName->tname);
|
||||
ctgDebug("tb:%s.%s not in cache", dbFName, pName->tname);
|
||||
CTG_ERR_JRET(ctgAddTSMAFetch(&pCtx->pFetches, dbIdx, i, fetchIdx, baseResIdx + i, flag, FETCH_TSMA_SOURCE_TB_META, NULL));
|
||||
if (NULL == taosArrayPush(pCtx->pResList, &(SMetaRes){0})) {
|
||||
CTG_ERR_JRET(terrno);
|
||||
|
@ -3950,7 +3950,7 @@ int32_t ctgGetTbTSMAFromCache(SCatalog* pCtg, SCtgTbTSMACtx* pCtx, int32_t dbIdx
|
|||
CTG_LOCK(CTG_READ, &pTbCache->metaLock);
|
||||
if (!pTbCache->pMeta) {
|
||||
CTG_UNLOCK(CTG_READ, &pTbCache->metaLock);
|
||||
ctgDebug("tb: %s.%s not in cache", dbFName, pName->tname);
|
||||
ctgDebug("tb:%s.%s not in cache", dbFName, pName->tname);
|
||||
|
||||
CTG_ERR_JRET(ctgAddTSMAFetch(&pCtx->pFetches, dbIdx, i, fetchIdx, baseResIdx + i, flag, FETCH_TSMA_SOURCE_TB_META, NULL));
|
||||
if (NULL == taosArrayPush(pCtx->pResList, &(SMetaRes){0})) {
|
||||
|
@ -3975,7 +3975,7 @@ int32_t ctgGetTbTSMAFromCache(SCatalog* pCtg, SCtgTbTSMACtx* pCtx, int32_t dbIdx
|
|||
(void)snprintf(tsmaSourceTbName.tname, TMIN(TSDB_TABLE_NAME_LEN, strlen(stbName) + 1), "%s", stbName);
|
||||
taosHashRelease(dbCache->stbCache, stbName);
|
||||
} else {
|
||||
ctgDebug("stb in db: %s, uid: %" PRId64 " not in cache", dbFName, suid);
|
||||
ctgDebug("suid:0x%" PRIx64 ", stb not in cache, db:%s", suid, dbFName);
|
||||
|
||||
CTG_ERR_JRET(ctgAddTSMAFetch(&pCtx->pFetches, dbIdx, i, fetchIdx, baseResIdx + i, flag, FETCH_TSMA_SOURCE_TB_META, NULL));
|
||||
if (NULL == taosArrayPush(pCtx->pResList, &(SMetaRes){0})) {
|
||||
|
@ -4009,7 +4009,7 @@ int32_t ctgGetTbTSMAFromCache(SCatalog* pCtg, SCtgTbTSMACtx* pCtx, int32_t dbIdx
|
|||
if (pCache->retryFetch || hasOutOfDateTSMACache(pCache->pTsmas)) {
|
||||
CTG_UNLOCK(CTG_READ, &pCache->tsmaLock);
|
||||
|
||||
ctgDebug("tsma for tb: %s.%s not in cache", tsmaSourceTbName.tname, dbFName);
|
||||
ctgDebug("tsma for tb:%s.%s not in cache", tsmaSourceTbName.tname, dbFName);
|
||||
|
||||
CTG_ERR_JRET(ctgAddTSMAFetch(&pCtx->pFetches, dbIdx, i, fetchIdx, baseResIdx + i, flag, FETCH_TB_TSMA, &tsmaSourceTbName));
|
||||
if (NULL == taosArrayPush(pCtx->pResList, &(SMetaRes){0})) {
|
||||
|
@ -4086,7 +4086,7 @@ int32_t ctgGetTSMAFromCache(SCatalog* pCtg, SCtgTbTSMACtx* pCtx, SName* pTsmaNam
|
|||
|
||||
CTG_ERR_RET(ctgAcquireDBCache(pCtg, dbFName, &pDbCache));
|
||||
if (!pDbCache) {
|
||||
ctgDebug("DB %s not in cache", dbFName);
|
||||
ctgTrace("db:%s, db not in cache", dbFName);
|
||||
CTG_RET(code);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ int32_t ctgHandleBatchRsp(SCtgJob* pJob, SCtgTaskCallbackParam* cbParam, SDataBu
|
|||
msgNum = 0;
|
||||
}
|
||||
|
||||
ctgDebug("QID:0x%" PRIx64 " ctg got batch %d rsp %s", pJob->queryId, cbParam->batchId,
|
||||
ctgDebug("QID:0x%" PRIx64 ", ctg got batch:%d rsp:%s", pJob->queryId, cbParam->batchId,
|
||||
TMSG_INFO(cbParam->reqType + 1));
|
||||
|
||||
SHashObj* pBatchs = taosHashInit(taskNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK);
|
||||
|
@ -109,13 +109,13 @@ int32_t ctgHandleBatchRsp(SCtgJob* pJob, SCtgTaskCallbackParam* cbParam, SDataBu
|
|||
tReq.msgIdx = pRsp->msgIdx;
|
||||
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, tReq.msgIdx);
|
||||
if (NULL == pMsgCtx) {
|
||||
ctgError("get task %d SCtgMsgCtx failed, taskType:%d", tReq.msgIdx, pTask->type);
|
||||
ctgError("task:%d, get SCtgMsgCtx failed, taskType:%d", tReq.msgIdx, pTask->type);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
pMsgCtx->pBatchs = pBatchs;
|
||||
|
||||
ctgDebug("QID:0x%" PRIx64 " ctg task %d idx %d start to handle rsp %s, pBatchs: %p", pJob->queryId, pTask->taskId,
|
||||
ctgDebug("QID:0x%" PRIx64 ", ctg task:%d idx:%d start to handle rsp:%s, pBatchs:%p", pJob->queryId, pTask->taskId,
|
||||
pRsp->msgIdx, TMSG_INFO(taskMsg.msgType + 1), pBatchs);
|
||||
|
||||
(void)(*gCtgAsyncFps[pTask->type].handleRspFp)(
|
||||
|
@ -144,11 +144,11 @@ int32_t ctgProcessRspMsg(void* out, int32_t reqType, char* msg, int32_t msgSize,
|
|||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process qnode list rsp failed, error:%s", tstrerror(rspCode));
|
||||
qError("process qnode list rsp failed, error:%s", tstrerror(rspCode));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got qnode list from mnode, listNum:%d", (int32_t)taosArrayGetSize(out));
|
||||
qDebug("get qnode list from mnode, listNum:%d", (int32_t)taosArrayGetSize(out));
|
||||
break;
|
||||
}
|
||||
case TDMT_MND_DNODE_LIST: {
|
||||
|
@ -159,194 +159,194 @@ int32_t ctgProcessRspMsg(void* out, int32_t reqType, char* msg, int32_t msgSize,
|
|||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process dnode list rsp failed, error:%s", tstrerror(rspCode));
|
||||
qError("process dnode list rsp failed, error:%s", tstrerror(rspCode));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got dnode list from mnode, listNum:%d", (int32_t)taosArrayGetSize(*(SArray**)out));
|
||||
qDebug("get dnode list from mnode, listNum:%d", (int32_t)taosArrayGetSize(*(SArray**)out));
|
||||
break;
|
||||
}
|
||||
case TDMT_MND_USE_DB: {
|
||||
if (TSDB_CODE_SUCCESS != rspCode) {
|
||||
qError("error rsp for use db, error:%s, dbFName:%s", tstrerror(rspCode), target);
|
||||
qError("db:%s, error rsp for use db, error:%s", target, tstrerror(rspCode));
|
||||
CTG_ERR_RET(rspCode);
|
||||
}
|
||||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process use db rsp failed, error:%s, dbFName:%s", tstrerror(code), target);
|
||||
qError("db:%s, process use db rsp failed, error:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got db vgInfo from mnode, dbFName:%s", target);
|
||||
qDebug("db:%s, get db vgInfo from mnode", target);
|
||||
break;
|
||||
}
|
||||
case TDMT_MND_GET_DB_CFG: {
|
||||
if (TSDB_CODE_SUCCESS != rspCode) {
|
||||
qError("error rsp for get db cfg, error:%s, db:%s", tstrerror(rspCode), target);
|
||||
qError("db:%s, error rsp for get db cfg, error:%s", target, tstrerror(rspCode));
|
||||
CTG_ERR_RET(rspCode);
|
||||
}
|
||||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process get db cfg rsp failed, error:%s, db:%s", tstrerror(code), target);
|
||||
qError("db:%s, process get db cfg rsp failed, error:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got db cfg from mnode, dbFName:%s", target);
|
||||
qDebug("db:%s, get db cfg from mnode", target);
|
||||
break;
|
||||
}
|
||||
case TDMT_MND_GET_INDEX: {
|
||||
if (TSDB_CODE_SUCCESS != rspCode) {
|
||||
qError("error rsp for get index, error:%s, indexName:%s", tstrerror(rspCode), target);
|
||||
qError("index:%s, error rsp for get index, error:%s", target, tstrerror(rspCode));
|
||||
CTG_ERR_RET(rspCode);
|
||||
}
|
||||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process get index rsp failed, error:%s, indexName:%s", tstrerror(code), target);
|
||||
qError("index:%s, process get index rsp failed, error:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got index from mnode, indexName:%s", target);
|
||||
qDebug("index:%s, get index from mnode", target);
|
||||
break;
|
||||
}
|
||||
case TDMT_MND_GET_TABLE_INDEX: {
|
||||
if (TSDB_CODE_SUCCESS != rspCode) {
|
||||
qError("error rsp for get table index, error:%s, tbFName:%s", tstrerror(rspCode), target);
|
||||
qError("tb:%s, error rsp for get table index, error:%s", target, tstrerror(rspCode));
|
||||
CTG_ERR_RET(rspCode);
|
||||
}
|
||||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process get table index rsp failed, error:%s, tbFName:%s", tstrerror(code), target);
|
||||
qError("tb:%s, process get table index rsp failed, error:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got table index from mnode, tbFName:%s", target);
|
||||
qDebug("tb:%s, get table index from mnode", target);
|
||||
break;
|
||||
}
|
||||
case TDMT_MND_RETRIEVE_FUNC: {
|
||||
if (TSDB_CODE_SUCCESS != rspCode) {
|
||||
qError("error rsp for get udf, error:%s, funcName:%s", tstrerror(rspCode), target);
|
||||
qError("func:%s, error rsp for get udf, error:%s", target, tstrerror(rspCode));
|
||||
CTG_ERR_RET(rspCode);
|
||||
}
|
||||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process get udf rsp failed, error:%s, funcName:%s", tstrerror(code), target);
|
||||
qError("func:%s, Process get udf rsp failed, error:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got udf from mnode, funcName:%s", target);
|
||||
qDebug("func:%s, get udf from mnode", target);
|
||||
break;
|
||||
}
|
||||
case TDMT_MND_GET_USER_AUTH: {
|
||||
if (TSDB_CODE_SUCCESS != rspCode) {
|
||||
qError("error rsp for get user auth, error:%s, user:%s", tstrerror(rspCode), target);
|
||||
qError("user:%s, error rsp for get user auth, error:%s", target, tstrerror(rspCode));
|
||||
CTG_ERR_RET(rspCode);
|
||||
}
|
||||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process get user auth rsp failed, error:%s, user:%s", tstrerror(code), target);
|
||||
qError("user:%s, process get user auth rsp failed, error:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got user auth from mnode, user:%s", target);
|
||||
qDebug("user:%s, get user auth from mnode", target);
|
||||
break;
|
||||
}
|
||||
case TDMT_MND_TABLE_META: {
|
||||
if (TSDB_CODE_SUCCESS != rspCode) {
|
||||
if (CTG_TABLE_NOT_EXIST(rspCode)) {
|
||||
SET_META_TYPE_NULL(((STableMetaOutput*)out)->metaType);
|
||||
qDebug("stablemeta not exist in mnode, tbFName:%s", target);
|
||||
qDebug("tb:%s, stablemeta not exist in mnode", target);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
qError("error rsp for stablemeta from mnode, error:%s, tbFName:%s", tstrerror(rspCode), target);
|
||||
qError("tb:%s, error rsp for stablemeta from mnode, error:%s", target, tstrerror(rspCode));
|
||||
CTG_ERR_RET(rspCode);
|
||||
}
|
||||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process mnode stablemeta rsp failed, error:%s, tbFName:%s", tstrerror(code), target);
|
||||
qError("tb:%s, process mnode stablemeta rsp failed, error:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got table meta from mnode, tbFName:%s", target);
|
||||
qDebug("tb:%s, get table meta from mnode", target);
|
||||
break;
|
||||
}
|
||||
case TDMT_VND_TABLE_META: {
|
||||
if (TSDB_CODE_SUCCESS != rspCode) {
|
||||
if (CTG_TABLE_NOT_EXIST(rspCode)) {
|
||||
SET_META_TYPE_NULL(((STableMetaOutput*)out)->metaType);
|
||||
qDebug("tablemeta not exist in vnode, tbFName:%s", target);
|
||||
qDebug("tb:%s, tablemeta not exist in vnode", target);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
qError("error rsp for table meta from vnode, code:%s, tbFName:%s", tstrerror(rspCode), target);
|
||||
qError("tb:%s, error rsp for table meta from vnode, code:%s", target, tstrerror(rspCode));
|
||||
CTG_ERR_RET(rspCode);
|
||||
}
|
||||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process vnode tablemeta rsp failed, code:%s, tbFName:%s", tstrerror(code), target);
|
||||
qError("tb:%s, process vnode tablemeta rsp failed, code:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got table meta from vnode, tbFName:%s", target);
|
||||
qDebug("tb:%s, get table meta from vnode", target);
|
||||
break;
|
||||
}
|
||||
case TDMT_VND_TABLE_NAME: {
|
||||
if (TSDB_CODE_SUCCESS != rspCode) {
|
||||
if (CTG_TABLE_NOT_EXIST(rspCode)) {
|
||||
SET_META_TYPE_NULL(((STableMetaOutput*)out)->metaType);
|
||||
qDebug("tablemeta not exist in vnode, tbFName:%s", target);
|
||||
qDebug("tb:%s, tablemeta not exist in vnode", target);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
qError("error rsp for table meta from vnode, code:%s, tbFName:%s", tstrerror(rspCode), target);
|
||||
qError("tb:%s, error rsp for table meta from vnode, code:%s", target, tstrerror(rspCode));
|
||||
CTG_ERR_RET(rspCode);
|
||||
}
|
||||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process vnode tablemeta rsp failed, code:%s, tbFName:%s", tstrerror(code), target);
|
||||
qError("tb:%s, process vnode tablemeta rsp failed, code:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got table meta from vnode, tbFName:%s", target);
|
||||
qDebug("tb:%s, get table meta from vnode", target);
|
||||
break;
|
||||
}
|
||||
case TDMT_VND_TABLE_CFG: {
|
||||
if (TSDB_CODE_SUCCESS != rspCode) {
|
||||
qError("error rsp for table cfg from vnode, code:%s, tbFName:%s", tstrerror(rspCode), target);
|
||||
qError("tb:%s, error rsp for table cfg from vnode, code:%s,", target, tstrerror(rspCode));
|
||||
CTG_ERR_RET(rspCode);
|
||||
}
|
||||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process vnode tb cfg rsp failed, code:%s, tbFName:%s", tstrerror(code), target);
|
||||
qError("tb:%s, process vnode tb cfg rsp failed, code:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got table cfg from vnode, tbFName:%s", target);
|
||||
qDebug("tb:%s, get table cfg from vnode", target);
|
||||
break;
|
||||
}
|
||||
case TDMT_MND_TABLE_CFG: {
|
||||
if (TSDB_CODE_SUCCESS != rspCode) {
|
||||
qError("error rsp for stb cfg from mnode, error:%s, tbFName:%s", tstrerror(rspCode), target);
|
||||
qError("tb:%s, error rsp for stb cfg from mnode, error:%s", target, tstrerror(rspCode));
|
||||
CTG_ERR_RET(rspCode);
|
||||
}
|
||||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process mnode stb cfg rsp failed, error:%s, tbFName:%s", tstrerror(code), target);
|
||||
qError("tb:%s, Process mnode stb cfg rsp failed, error:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got stb cfg from mnode, tbFName:%s", target);
|
||||
qDebug("tb:%s, get stb cfg from mnode", target);
|
||||
break;
|
||||
}
|
||||
case TDMT_MND_SERVER_VERSION: {
|
||||
|
@ -357,11 +357,11 @@ int32_t ctgProcessRspMsg(void* out, int32_t reqType, char* msg, int32_t msgSize,
|
|||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process svr ver rsp failed, error:%s", tstrerror(code));
|
||||
qError("process svr ver rsp failed, error:%s", tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got svr ver from mnode");
|
||||
qDebug("get svr ver from mnode");
|
||||
break;
|
||||
}
|
||||
case TDMT_MND_VIEW_META: {
|
||||
|
@ -376,29 +376,29 @@ int32_t ctgProcessRspMsg(void* out, int32_t reqType, char* msg, int32_t msgSize,
|
|||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process get view-meta rsp failed, error:%s, viewFName:%s", tstrerror(code), target);
|
||||
qError("view:%s, process get view-meta rsp failed, error:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got view-meta from mnode, viewFName:%s", target);
|
||||
qDebug("view:%s, get view-meta from mnode", target);
|
||||
break;
|
||||
}
|
||||
case TDMT_MND_GET_TSMA:
|
||||
case TDMT_MND_GET_TABLE_TSMA: {
|
||||
if (TSDB_CODE_SUCCESS != rspCode) {
|
||||
if (TSDB_CODE_MND_SMA_NOT_EXIST != rspCode) {
|
||||
qError("error rsp for get table tsma, error:%s, tbFName:%s", tstrerror(rspCode), target);
|
||||
qError("tb:%s, error rsp for get table tsma, error:%s", target, tstrerror(rspCode));
|
||||
}
|
||||
CTG_ERR_RET(rspCode);
|
||||
}
|
||||
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process get table tsma rsp failed, error:%s, tbFName:%s", tstrerror(code), target);
|
||||
qError("tb:%s, Process get table tsma rsp failed, error:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
|
||||
qDebug("Got table tsma from mnode, tbFName:%s", target);
|
||||
qDebug("tb:%s, get table tsma from mnode", target);
|
||||
break;
|
||||
}
|
||||
case TDMT_VND_GET_STREAM_PROGRESS: {
|
||||
|
@ -407,14 +407,14 @@ int32_t ctgProcessRspMsg(void* out, int32_t reqType, char* msg, int32_t msgSize,
|
|||
}
|
||||
code = queryProcessMsgRsp[TMSG_INDEX(reqType)](out, msg, msgSize);
|
||||
if (code) {
|
||||
qError("Process get stream progress rsp failed, err: %s, tbFName: %s", tstrerror(code), target);
|
||||
qError("tb:%s, process get stream progress rsp failed, error:%s", target, tstrerror(code));
|
||||
CTG_ERR_RET(code);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (TSDB_CODE_SUCCESS != rspCode) {
|
||||
qError("Got error rsp, error:%s", tstrerror(rspCode));
|
||||
qError("get error rsp, error:%s", tstrerror(rspCode));
|
||||
CTG_ERR_RET(rspCode);
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ int32_t ctgHandleMsgCallback(void* param, SDataBuf* pMsg, int32_t rspCode) {
|
|||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
qDebug("QID:0x%" PRIx64 " ctg task %d start to handle rsp %s", pJob->queryId, pTask->taskId,
|
||||
qDebug("QID:0x%" PRIx64 ", ctg task:%d start to handle rsp:%s", pJob->queryId, pTask->taskId,
|
||||
TMSG_INFO(cbParam->reqType + 1));
|
||||
|
||||
#if CTG_BATCH_FETCH
|
||||
|
@ -468,7 +468,7 @@ int32_t ctgHandleMsgCallback(void* param, SDataBuf* pMsg, int32_t rspCode) {
|
|||
|
||||
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, -1);
|
||||
if (NULL == pMsgCtx) {
|
||||
ctgError("get task %d SCtgMsgCtx failed, taskType:%d", -1, pTask->type);
|
||||
ctgError("task:%d, get SCtgMsgCtx failed, taskType:%d", -1, pTask->type);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
|
@ -562,7 +562,7 @@ int32_t ctgAsyncSendMsg(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgJob* pJob,
|
|||
CTG_ERR_JRET(code);
|
||||
}
|
||||
|
||||
ctgDebug("ctg req msg sent,QID:0x%" PRIx64 ", msg type:%d, %s", pJob->queryId, msgType, TMSG_INFO(msgType));
|
||||
ctgDebug("ctg req msg sent, QID:0x%" PRIx64 ", msg type:%d, %s", pJob->queryId, msgType, TMSG_INFO(msgType));
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
||||
_return:
|
||||
|
@ -583,7 +583,7 @@ int32_t ctgAddBatch(SCatalog* pCtg, int32_t vgId, SRequestConnInfo* pConn, SCtgT
|
|||
SBatchMsg req = {0};
|
||||
SCtgMsgCtx* pMsgCtx = CTG_GET_TASK_MSGCTX(pTask, tReq->msgIdx);
|
||||
if (NULL == pMsgCtx) {
|
||||
ctgError("get task %d SCtgMsgCtx failed, taskType:%d", tReq->msgIdx, pTask->type);
|
||||
ctgError("task:%d, get SCtgMsgCtx failed, taskType:%d", tReq->msgIdx, pTask->type);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
|
@ -677,7 +677,7 @@ int32_t ctgAddBatch(SCatalog* pCtg, int32_t vgId, SRequestConnInfo* pConn, SCtgT
|
|||
CTG_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
ctgDebug("task %d %s req added to batch %d, target vgId %d", pTask->taskId, TMSG_INFO(msgType), newBatch.batchId,
|
||||
ctgDebug("task:%d, %s req added to batch:%d, target vgId:%d", pTask->taskId, TMSG_INFO(msgType), newBatch.batchId,
|
||||
vgId);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -751,7 +751,7 @@ int32_t ctgAddBatch(SCatalog* pCtg, int32_t vgId, SRequestConnInfo* pConn, SCtgT
|
|||
(void)tNameGetFullDbName(pName, pBatch->dbFName);
|
||||
}
|
||||
|
||||
ctgDebug("task %d %s req added to batch %d, target vgId %d", pTask->taskId, TMSG_INFO(msgType), pBatch->batchId,
|
||||
ctgDebug("task:%d, %s req added to batch:%d, target vgId:%d", pTask->taskId, TMSG_INFO(msgType), pBatch->batchId,
|
||||
vgId);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -795,7 +795,7 @@ int32_t ctgBuildBatchReqMsg(SCtgBatch* pBatch, int32_t vgId, void** msg, int32_t
|
|||
|
||||
*pSize = msgSize;
|
||||
|
||||
qDebug("batch req %d to vg %d msg built with %d meta reqs", pBatch->batchId, vgId, num);
|
||||
qDebug("batch:%d, batch req to vgId:%d msg built with %d meta reqs", pBatch->batchId, vgId, num);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -810,7 +810,7 @@ int32_t ctgLaunchBatchs(SCatalog* pCtg, SCtgJob* pJob, SHashObj* pBatchs) {
|
|||
SCtgBatch* pBatch = (SCtgBatch*)p;
|
||||
int32_t msgSize = 0;
|
||||
|
||||
ctgDebug("QID:0x%" PRIx64 " ctg start to launch batch %d", pJob->queryId, pBatch->batchId);
|
||||
ctgDebug("QID:0x%" PRIx64 ", ctg start to launch batch:%d", pJob->queryId, pBatch->batchId);
|
||||
|
||||
CTG_ERR_JRET(ctgBuildBatchReqMsg(pBatch, *vgId, &msg, &msgSize));
|
||||
code = ctgAsyncSendMsg(pCtg, &pBatch->conn, pJob, pBatch->pTaskIds, pBatch->batchId, pBatch->pMsgIdxs,
|
||||
|
|
|
@ -50,21 +50,21 @@ int32_t ctgMetaRentAdd(SCtgRentMgmt *mgmt, void *meta, int64_t id, int32_t size)
|
|||
if (NULL == slot->meta) {
|
||||
slot->meta = taosArrayInit(CTG_DEFAULT_RENT_SLOT_SIZE, size);
|
||||
if (NULL == slot->meta) {
|
||||
qError("taosArrayInit %d failed, id:0x%" PRIx64 ", slot idx:%d, type:%d", CTG_DEFAULT_RENT_SLOT_SIZE, id, widx,
|
||||
qError("id:0x%" PRIx64 ", taosArrayInit %d failed, slot idx:%d, type:%d", id, CTG_DEFAULT_RENT_SLOT_SIZE, widx,
|
||||
mgmt->type);
|
||||
CTG_ERR_JRET(terrno);
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL == taosArrayPush(slot->meta, meta)) {
|
||||
qError("taosArrayPush meta to rent failed, id:0x%" PRIx64 ", slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
qError("id:0x%" PRIx64 ", taosArrayPush meta to rent failed, slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
CTG_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
mgmt->rentCacheSize += size;
|
||||
slot->needSort = true;
|
||||
|
||||
qDebug("add meta to rent, id:0x%" PRIx64 ", slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
qDebug("id:0x%" PRIx64 ", add meta to rent, slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
|
||||
_return:
|
||||
|
||||
|
@ -81,36 +81,37 @@ int32_t ctgMetaRentUpdate(SCtgRentMgmt *mgmt, void *meta, int64_t id, int32_t si
|
|||
|
||||
CTG_LOCK(CTG_WRITE, &slot->lock);
|
||||
if (NULL == slot->meta) {
|
||||
qDebug("empty meta slot, id:0x%" PRIx64 ", slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
qDebug("id:0x%" PRIx64 ", empty meta slot, slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
if (slot->needSort) {
|
||||
qDebug("meta slot before sorte, slot idx:%d, type:%d, size:%d", widx, mgmt->type,
|
||||
qDebug("id:0x%" PRIx64 ", meta slot before sort, slot idx:%d, type:%d, size:%d", id, widx, mgmt->type,
|
||||
(int32_t)taosArrayGetSize(slot->meta));
|
||||
taosArraySort(slot->meta, sortCompare);
|
||||
slot->needSort = false;
|
||||
qDebug("meta slot sorted, slot idx:%d, type:%d, size:%d", widx, mgmt->type, (int32_t)taosArrayGetSize(slot->meta));
|
||||
qDebug("id:0x%" PRIx64 ", meta slot sorted, slot idx:%d, type:%d, size:%d", id, widx, mgmt->type,
|
||||
(int32_t)taosArrayGetSize(slot->meta));
|
||||
}
|
||||
|
||||
void *orig = taosArraySearch(slot->meta, &id, searchCompare, TD_EQ);
|
||||
if (NULL == orig) {
|
||||
qDebug("meta not found in slot, id:0x%" PRIx64 ", slot idx:%d, type:%d, size:%d", id, widx, mgmt->type,
|
||||
qDebug("id:0x%" PRIx64 ", meta not found in slot, slot idx:%d, type:%d, size:%d", id, widx, mgmt->type,
|
||||
(int32_t)taosArrayGetSize(slot->meta));
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
TAOS_MEMCPY(orig, meta, size);
|
||||
|
||||
qDebug("meta in rent updated, id:0x%" PRIx64 ", slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
qDebug("id:0x%" PRIx64 ", meta in rent updated, slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
|
||||
_return:
|
||||
|
||||
CTG_UNLOCK(CTG_WRITE, &slot->lock);
|
||||
|
||||
if (code) {
|
||||
qDebug("meta in rent update failed, will try to add it, code:%x, id:0x%" PRIx64 ", slot idx:%d, type:%d", code, id,
|
||||
widx, mgmt->type);
|
||||
qDebug("id:0x%" PRIx64 ", meta in rent update failed, will try to add it, code:0x%x, slot idx:%d, type:%d", id,
|
||||
code, widx, mgmt->type);
|
||||
CTG_RET(ctgMetaRentAdd(mgmt, meta, id, size));
|
||||
}
|
||||
|
||||
|
@ -125,26 +126,26 @@ int32_t ctgMetaRentRemove(SCtgRentMgmt *mgmt, int64_t id, __compar_fn_t sortComp
|
|||
|
||||
CTG_LOCK(CTG_WRITE, &slot->lock);
|
||||
if (NULL == slot->meta) {
|
||||
qError("empty meta slot, id:0x%" PRIx64 ", slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
qError("id:0x%" PRIx64 ", empty meta slot, slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
if (slot->needSort) {
|
||||
taosArraySort(slot->meta, sortCompare);
|
||||
slot->needSort = false;
|
||||
qDebug("meta slot sorted, slot idx:%d, type:%d", widx, mgmt->type);
|
||||
qDebug("id:0x%" PRIx64 ", meta slot sorted, slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
}
|
||||
|
||||
int32_t idx = taosArraySearchIdx(slot->meta, &id, searchCompare, TD_EQ);
|
||||
if (idx < 0) {
|
||||
qError("meta not found in slot, id:0x%" PRIx64 ", slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
qError("id:0x%" PRIx64 ", meta not found in slot, slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
taosArrayRemove(slot->meta, idx);
|
||||
mgmt->rentCacheSize -= mgmt->metaSize;
|
||||
|
||||
qDebug("meta in rent removed, id:0x%" PRIx64 ", slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
qDebug("id:0x%" PRIx64 ", meta in rent removed, slot idx:%d, type:%d", id, widx, mgmt->type);
|
||||
|
||||
_return:
|
||||
|
||||
|
@ -194,7 +195,7 @@ int32_t ctgMetaRentGetImpl(SCtgRentMgmt *mgmt, void **res, uint32_t *num, int32_
|
|||
|
||||
*num = (uint32_t)metaNum;
|
||||
|
||||
qDebug("Got %d meta from rent, type:%d", (int32_t)metaNum, mgmt->type);
|
||||
qDebug("get %d meta from rent, type:%d", (int32_t)metaNum, mgmt->type);
|
||||
|
||||
_return:
|
||||
|
||||
|
@ -239,7 +240,7 @@ void ctgRemoveStbRent(SCatalog *pCtg, SCtgDBCache *dbCache) {
|
|||
|
||||
code = ctgMetaRentRemove(&pCtg->stbRent, *suid, ctgStbVersionSortCompare, ctgStbVersionSearchCompare);
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
ctgDebug("stb removed from rent, suid:0x%" PRIx64, *suid);
|
||||
ctgDebug("suid:0x%" PRIx64 ", stb removed from rent", *suid);
|
||||
}
|
||||
|
||||
pIter = taosHashIterate(dbCache->stbCache, pIter);
|
||||
|
@ -257,7 +258,7 @@ void ctgRemoveViewRent(SCatalog *pCtg, SCtgDBCache *dbCache) {
|
|||
|
||||
if (TSDB_CODE_SUCCESS ==
|
||||
ctgMetaRentRemove(&pCtg->viewRent, viewId, ctgViewVersionSortCompare, ctgViewVersionSearchCompare)) {
|
||||
ctgDebug("view removed from rent, viewId:0x%" PRIx64, viewId);
|
||||
ctgDebug("viewId:0x%" PRIx64 ", view removed from rent", viewId);
|
||||
}
|
||||
|
||||
pIter = taosHashIterate(dbCache->viewCache, pIter);
|
||||
|
@ -276,7 +277,7 @@ void ctgRemoveTSMARent(SCatalog *pCtg, SCtgDBCache *dbCache) {
|
|||
for (int32_t i = 0; i < size; ++i) {
|
||||
STSMACache* pCache = taosArrayGetP(pCtgCache->pTsmas, i);
|
||||
if (TSDB_CODE_SUCCESS == ctgMetaRentRemove(&pCtg->tsmaRent, pCache->tsmaId, ctgTSMAVersionSortCompare, ctgTSMAVersionSearchCompare)) {
|
||||
ctgDebug("tsma removed from rent, viewId: %" PRIx64 " name: %s.%s.%s", pCache->tsmaId, pCache->dbFName, pCache->tb, pCache->name);
|
||||
ctgDebug("tsma:0x%" PRIx64 ", tsma removed from rent, name:%s.%s.%s", pCache->tsmaId, pCache->dbFName, pCache->tb, pCache->name);
|
||||
}
|
||||
}
|
||||
CTG_UNLOCK(CTG_READ, &pCtgCache->tsmaLock);
|
||||
|
@ -303,8 +304,8 @@ int32_t ctgUpdateRentStbVersion(SCatalog *pCtg, char *dbFName, char *tbName, uin
|
|||
CTG_ERR_RET(ctgMetaRentUpdate(&pCtg->stbRent, &metaRent, metaRent.suid, sizeof(SSTableVersion),
|
||||
ctgStbVersionSortCompare, ctgStbVersionSearchCompare));
|
||||
|
||||
ctgDebug("db %s,0x%" PRIx64 " stb %s,0x%" PRIx64 " sver %d tver %d smaVer %d updated to stbRent", dbFName, dbId,
|
||||
tbName, suid, metaRent.sversion, metaRent.tversion, metaRent.smaVer);
|
||||
ctgDebug("suid:0x%" PRIx64 ", db %s, dbId:0x%" PRIx64 ", stb:%s, sver:%d tver:%d smaVer:%d updated to stbRent", suid,
|
||||
dbFName, dbId, tbName, metaRent.sversion, metaRent.tversion, metaRent.smaVer);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -321,7 +322,7 @@ int32_t ctgUpdateRentViewVersion(SCatalog *pCtg, char *dbFName, char *viewName,
|
|||
CTG_ERR_RET(ctgMetaRentUpdate(&pCtg->viewRent, &metaRent, metaRent.viewId, sizeof(SViewVersion),
|
||||
ctgViewVersionSortCompare, ctgViewVersionSearchCompare));
|
||||
|
||||
ctgDebug("db %s,0x%" PRIx64 " view %s,0x%" PRIx64 " version %d updated to viewRent", dbFName, dbId, viewName, viewId, metaRent.version);
|
||||
ctgDebug("viewId:0x%" PRIx64 ", db %s, dbId:0x%" PRIx64 ", view %s, version:%d updated to viewRent", viewId, dbFName, dbId, viewName, metaRent.version);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -332,12 +333,12 @@ int32_t ctgUpdateRentTSMAVersion(SCatalog *pCtg, char *dbFName, const STSMACache
|
|||
tstrncpy(tsmaRent.name, pTsmaInfo->name, TSDB_TABLE_NAME_LEN);
|
||||
tstrncpy(tsmaRent.dbFName, dbFName, TSDB_DB_FNAME_LEN);
|
||||
tstrncpy(tsmaRent.tbName, pTsmaInfo->tb, TSDB_TABLE_NAME_LEN);
|
||||
|
||||
|
||||
CTG_ERR_RET(ctgMetaRentUpdate(&pCtg->tsmaRent, &tsmaRent, tsmaRent.tsmaId, sizeof(STSMAVersion),
|
||||
ctgTSMAVersionSortCompare, ctgTSMAVersionSearchCompare));
|
||||
|
||||
ctgDebug("db %s, 0x%" PRIx64 " tsma %s, 0x%" PRIx64 "version %d updated to tsmaRent", dbFName, tsmaRent.dbId,
|
||||
pTsmaInfo->name, pTsmaInfo->tsmaId, pTsmaInfo->version);
|
||||
|
||||
ctgDebug("tsma:0x%" PRIx64 ", db:%s, dbId:0x%" PRIx64 ", view:%s, version:%d updated to tsmaRent", pTsmaInfo->tsmaId,
|
||||
dbFName, tsmaRent.dbId, pTsmaInfo->name, pTsmaInfo->version);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -430,7 +430,7 @@ void ctgFreeHandle(SCatalog* pCtg) {
|
|||
|
||||
taosMemoryFree(pCtg);
|
||||
|
||||
ctgInfo("handle freed, clusterId:0x%" PRIx64, clusterId);
|
||||
ctgInfo("clusterId:0x%" PRIx64 ", handle freed", clusterId);
|
||||
}
|
||||
|
||||
void ctgClearHandleMeta(SCatalog* pCtg, int64_t* pClearedSize, int64_t* pCleardNum, bool* roundDone) {
|
||||
|
@ -541,7 +541,7 @@ void ctgClearHandle(SCatalog* pCtg) {
|
|||
|
||||
CTG_STAT_RT_INC(numOfOpClearCache, 1);
|
||||
|
||||
ctgInfo("handle cleared, clusterId:0x%" PRIx64, clusterId);
|
||||
ctgInfo("clusterId:0x%" PRIx64 ", handle cleared", clusterId);
|
||||
}
|
||||
|
||||
void ctgFreeSUseDbOutput(SUseDbOutput* pOutput) {
|
||||
|
@ -1097,7 +1097,7 @@ void ctgFreeJob(void* job) {
|
|||
|
||||
taosMemoryFree(job);
|
||||
|
||||
qDebug("QID:0x%" PRIx64 ", ctg job 0x%" PRIx64 " freed", qid, rid);
|
||||
qDebug("QID:0x%" PRIx64 ", ctg jobId:0x%" PRIx64 " freed", qid, rid);
|
||||
}
|
||||
|
||||
int32_t ctgUpdateMsgCtx(SCtgMsgCtx* pCtx, int32_t reqType, void* out, char* target) {
|
||||
|
@ -1196,7 +1196,7 @@ int32_t ctgGenerateVgList(SCatalog* pCtg, SHashObj* vgHash, SArray** pList, cons
|
|||
|
||||
*pList = vgList;
|
||||
|
||||
ctgDebug("Got vgList from cache, vgNum:%d", vgNum);
|
||||
ctgDebug("get vgList from cache, vgNum:%d", vgNum);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
||||
|
@ -1286,14 +1286,14 @@ int32_t ctgGetVgInfoFromHashValue(SCatalog* pCtg, SEpSet* pMgmtEps, SDBVgInfo* d
|
|||
*/
|
||||
|
||||
if (NULL == vgInfo) {
|
||||
ctgError("no hash range found for hash value [%u], db:%s, numOfVgId:%d", hashValue, db,
|
||||
ctgError("tb:%s, no hash range found for hash value [%u], db:%s, numOfVgId:%d", tbFullName, hashValue, db,
|
||||
(int32_t)taosArrayGetSize(dbInfo->vgArray));
|
||||
CTG_ERR_RET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
*pVgroup = *vgInfo;
|
||||
|
||||
ctgDebug("Got tb %s hash vgroup, vgId:%d, epNum %d, current %s port %d", tbFullName, vgInfo->vgId,
|
||||
ctgDebug("tb:%s, get hash vgroup, vgId:%d, epNum %d, current:%s port:%d", tbFullName, vgInfo->vgId,
|
||||
vgInfo->epSet.numOfEps, vgInfo->epSet.eps[vgInfo->epSet.inUse].fqdn,
|
||||
vgInfo->epSet.eps[vgInfo->epSet.inUse].port);
|
||||
|
||||
|
@ -1327,7 +1327,7 @@ int32_t ctgGetVgInfosFromHashValue(SCatalog* pCtg, SEpSet* pMgmgEpSet, SCtgTaskR
|
|||
|
||||
TAOS_MEMCPY(vgInfo, &mgmtInfo, sizeof(mgmtInfo));
|
||||
|
||||
ctgDebug("Got tb hash vgroup, vgId:%d, epNum %d, current %s port %d", vgInfo->vgId, vgInfo->epSet.numOfEps,
|
||||
ctgDebug("get tb hash vgroup, vgId:%d, epNum %d, current %s port %d", vgInfo->vgId, vgInfo->epSet.numOfEps,
|
||||
vgInfo->epSet.eps[vgInfo->epSet.inUse].fqdn, vgInfo->epSet.eps[vgInfo->epSet.inUse].port);
|
||||
|
||||
if (update) {
|
||||
|
@ -1376,7 +1376,7 @@ int32_t ctgGetVgInfosFromHashValue(SCatalog* pCtg, SEpSet* pMgmgEpSet, SCtgTaskR
|
|||
|
||||
TAOS_MEMCPY(vgInfo, pSrcVg, sizeof(*pSrcVg));
|
||||
|
||||
ctgDebug("Got tb hash vgroup, vgId:%d, epNum %d, current %s port %d", vgInfo->vgId, vgInfo->epSet.numOfEps,
|
||||
ctgDebug("get tb hash vgroup, vgId:%d, epNum %d, current %s port %d", vgInfo->vgId, vgInfo->epSet.numOfEps,
|
||||
vgInfo->epSet.eps[vgInfo->epSet.inUse].fqdn, vgInfo->epSet.eps[vgInfo->epSet.inUse].port);
|
||||
|
||||
if (update) {
|
||||
|
@ -1437,7 +1437,7 @@ int32_t ctgGetVgInfosFromHashValue(SCatalog* pCtg, SEpSet* pMgmgEpSet, SCtgTaskR
|
|||
|
||||
*pNewVg = *vgInfo;
|
||||
|
||||
ctgDebug("Got tb %s hash vgroup, vgId:%d, epNum %d, current %s port %d", tbFullName, vgInfo->vgId,
|
||||
ctgDebug("tb:%s, get hash vgroup, vgId:%d, epNum %d, current %s port %d", tbFullName, vgInfo->vgId,
|
||||
vgInfo->epSet.numOfEps, vgInfo->epSet.eps[vgInfo->epSet.inUse].fqdn,
|
||||
vgInfo->epSet.eps[vgInfo->epSet.inUse].port);
|
||||
|
||||
|
@ -1496,7 +1496,7 @@ int32_t ctgGetVgIdsFromHashValue(SCatalog* pCtg, SDBVgInfo* dbInfo, char* dbFNam
|
|||
|
||||
vgId[i] = vgInfo->vgId;
|
||||
|
||||
ctgDebug("Got tb %s vgId:%d", tbFullName, vgInfo->vgId);
|
||||
ctgDebug("tb:%s, get vgId:%d", tbFullName, vgInfo->vgId);
|
||||
}
|
||||
|
||||
CTG_RET(code);
|
||||
|
@ -1689,7 +1689,7 @@ int32_t ctgCloneMetaOutput(STableMetaOutput* output, STableMetaOutput** pOutput)
|
|||
}
|
||||
|
||||
(*pOutput)->tbMeta = taosMemoryMalloc(metaSize + schemaExtSize);
|
||||
qDebug("tbMeta cloned, size:%d, p:%p", metaSize, (*pOutput)->tbMeta);
|
||||
qTrace("tbmeta cloned, size:%d, p:%p", metaSize, (*pOutput)->tbMeta);
|
||||
if (NULL == (*pOutput)->tbMeta) {
|
||||
qError("malloc %d failed", (int32_t)sizeof(STableMetaOutput));
|
||||
taosMemoryFreeClear(*pOutput);
|
||||
|
@ -2076,7 +2076,7 @@ int32_t ctgChkSetTbAuthRes(SCatalog* pCtg, SCtgAuthReq* req, SCtgAuthRsp* res) {
|
|||
if (NULL == pMeta) {
|
||||
if (req->onlyCache) {
|
||||
res->metaNotExists = true;
|
||||
ctgDebug("db %s tb %s meta not in cache for auth", req->pRawReq->tbName.dbname, req->pRawReq->tbName.tname);
|
||||
ctgDebug("db:%s, tb:%s meta not in cache for auth", req->pRawReq->tbName.dbname, req->pRawReq->tbName.tname);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
|
@ -2097,7 +2097,7 @@ int32_t ctgChkSetTbAuthRes(SCatalog* pCtg, SCtgAuthReq* req, SCtgAuthRsp* res) {
|
|||
if (NULL == stbName) {
|
||||
if (req->onlyCache) {
|
||||
res->metaNotExists = true;
|
||||
ctgDebug("suid %" PRIu64 " name not in cache for auth", pMeta->suid);
|
||||
ctgDebug("suid:%" PRIu64 ", name not in cache for auth", pMeta->suid);
|
||||
goto _return;
|
||||
}
|
||||
|
||||
|
@ -2108,7 +2108,7 @@ int32_t ctgChkSetTbAuthRes(SCatalog* pCtg, SCtgAuthReq* req, SCtgAuthRsp* res) {
|
|||
continue;
|
||||
}
|
||||
|
||||
ctgError("Invalid table type %d for %s", pMeta->tableType, tbFName);
|
||||
ctgError("invalid table type %d for %s", pMeta->tableType, tbFName);
|
||||
CTG_ERR_JRET(TSDB_CODE_INVALID_PARA);
|
||||
}
|
||||
|
||||
|
@ -2740,8 +2740,8 @@ bool isCtgTSMACacheOutOfDate(STSMACache* pTsmaCache) {
|
|||
bool ret = !pTsmaCache->fillHistoryFinished ||
|
||||
(tsMaxTsmaCalcDelay * 1000 - pTsmaCache->delayDuration) < (now - pTsmaCache->reqTs);
|
||||
if (ret) {
|
||||
qDebug("tsma %s.%s in cache has been out of date, history finished: %d, remain valid after: %" PRId64
|
||||
" passed: %" PRId64,
|
||||
qDebug("tsma:%s.%s in cache has been out of date, history finished:%d, remain valid after:%" PRId64
|
||||
" passed:%" PRId64,
|
||||
pTsmaCache->dbFName, pTsmaCache->name, pTsmaCache->fillHistoryFinished,
|
||||
tsMaxTsmaCalcDelay * 1000 - pTsmaCache->delayDuration, now - pTsmaCache->reqTs);
|
||||
}
|
||||
|
|
|
@ -360,7 +360,7 @@ int32_t doAggregateImpl(SOperatorInfo* pOperator, SqlFunctionCtx* pCtx) {
|
|||
if (pCtx[k].fpSet.cleanup != NULL) {
|
||||
pCtx[k].fpSet.cleanup(&pCtx[k]);
|
||||
}
|
||||
qError("%s aggregate function error happens, code: %s", GET_TASKID(pOperator->pTaskInfo), tstrerror(code));
|
||||
qError("%s aggregate function error happens, code:%s", GET_TASKID(pOperator->pTaskInfo), tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
@ -803,7 +803,7 @@ int32_t applyAggFunctionOnPartialTuples(SExecTaskInfo* taskInfo, SqlFunctionCtx*
|
|||
if (pCtx[k].fpSet.cleanup != NULL) {
|
||||
pCtx[k].fpSet.cleanup(&pCtx[k]);
|
||||
}
|
||||
qError("%s apply functions error, code: %s", GET_TASKID(taskInfo), tstrerror(code));
|
||||
qError("%s apply functions error, code:%s", GET_TASKID(taskInfo), tstrerror(code));
|
||||
taskInfo->code = code;
|
||||
return code;
|
||||
}
|
||||
|
|
|
@ -2911,7 +2911,7 @@ int32_t createScanTableListInfo(SScanPhysiNode* pScanNode, SNodeList* pGroupTags
|
|||
int32_t code = getTableList(pHandle->vnode, pScanNode, pTagCond, pTagIndexCond, pTableListInfo, digest, idStr,
|
||||
&pTaskInfo->storageAPI);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
qError("failed to getTableList, code: %s", tstrerror(code));
|
||||
qError("failed to getTableList, code:%s", tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
|
@ -645,7 +645,7 @@ int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId,
|
|||
|
||||
int32_t code = createExecTaskInfo(pSubplan, pTask, readHandle, taskId, vgId, sql, model);
|
||||
if (code != TSDB_CODE_SUCCESS || NULL == *pTask) {
|
||||
qError("failed to createExecTaskInfo, code: %s", tstrerror(code));
|
||||
qError("failed to createExecTaskInfo, code:%s", tstrerror(code));
|
||||
goto _error;
|
||||
}
|
||||
|
||||
|
@ -995,26 +995,43 @@ int32_t qAsyncKillTask(qTaskInfo_t qinfo, int32_t rspCode) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t qKillTask(qTaskInfo_t tinfo, int32_t rspCode) {
|
||||
int32_t qKillTask(qTaskInfo_t tinfo, int32_t rspCode, int64_t waitDuration) {
|
||||
int64_t st = taosGetTimestampMs();
|
||||
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
|
||||
if (pTaskInfo == NULL) {
|
||||
return TSDB_CODE_QRY_INVALID_QHANDLE;
|
||||
}
|
||||
|
||||
qDebug("%s sync killed execTask", GET_TASKID(pTaskInfo));
|
||||
if (waitDuration > 0) {
|
||||
qDebug("%s sync killed execTask, and waiting for %.2fs", GET_TASKID(pTaskInfo), waitDuration/1000.0);
|
||||
} else {
|
||||
qDebug("%s async killed execTask", GET_TASKID(pTaskInfo));
|
||||
}
|
||||
|
||||
setTaskKilled(pTaskInfo, TSDB_CODE_TSC_QUERY_KILLED);
|
||||
|
||||
while (1) {
|
||||
taosWLockLatch(&pTaskInfo->lock);
|
||||
if (qTaskIsExecuting(pTaskInfo)) { // let's wait for 100 ms and try again
|
||||
taosWUnLockLatch(&pTaskInfo->lock);
|
||||
taosMsleep(100);
|
||||
} else { // not running now
|
||||
pTaskInfo->code = rspCode;
|
||||
taosWUnLockLatch(&pTaskInfo->lock);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
if (waitDuration > 0) {
|
||||
while (1) {
|
||||
taosWLockLatch(&pTaskInfo->lock);
|
||||
if (qTaskIsExecuting(pTaskInfo)) { // let's wait for 100 ms and try again
|
||||
taosWUnLockLatch(&pTaskInfo->lock);
|
||||
|
||||
taosMsleep(200);
|
||||
|
||||
int64_t d = taosGetTimestampMs() - st;
|
||||
if (d >= waitDuration && waitDuration >= 0) {
|
||||
qWarn("%s waiting more than %.2fs, not wait anymore", GET_TASKID(pTaskInfo), waitDuration / 1000.0);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
} else { // not running now
|
||||
pTaskInfo->code = rspCode;
|
||||
taosWUnLockLatch(&pTaskInfo->lock);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
bool qTaskIsExecuting(qTaskInfo_t qinfo) {
|
||||
|
|
|
@ -292,7 +292,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) {
|
|||
SqlFunctionCtx* pCtx = pOperator->exprSupp.pCtx;
|
||||
int32_t numOfGroupCols = taosArrayGetSize(pInfo->pGroupCols);
|
||||
// if (type == TSDB_DATA_TYPE_FLOAT || type == TSDB_DATA_TYPE_DOUBLE) {
|
||||
// qError("QInfo:0x%"PRIx64" group by not supported on double/float columns, abort", GET_TASKID(pRuntimeEnv));
|
||||
// qError("QInfo:0x%" PRIx64 ", group by not supported on double/float columns, abort", GET_TASKID(pRuntimeEnv));
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
|
|
@ -349,7 +349,7 @@ int32_t createOperator(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, SReadHand
|
|||
if (code) {
|
||||
pTaskInfo->code = code;
|
||||
tableListDestroy(pTableListInfo);
|
||||
qError("failed to createScanTableListInfo, code: %s", tstrerror(code));
|
||||
qError("failed to createScanTableListInfo, code:%s", tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
|
@ -387,7 +387,7 @@ int32_t createOperator(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, SReadHand
|
|||
if (code) {
|
||||
pTaskInfo->code = code;
|
||||
tableListDestroy(pTableListInfo);
|
||||
qError("failed to createScanTableListInfo, code: %s", tstrerror(code));
|
||||
qError("failed to createScanTableListInfo, code:%s", tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
@ -417,7 +417,7 @@ int32_t createOperator(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, SReadHand
|
|||
pTagIndexCond, pTaskInfo);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
pTaskInfo->code = code;
|
||||
qError("failed to getTableList, code: %s", tstrerror(code));
|
||||
qError("failed to getTableList, code:%s", tstrerror(code));
|
||||
tableListDestroy(pTableListInfo);
|
||||
return code;
|
||||
}
|
||||
|
|
|
@ -42,9 +42,7 @@ typedef struct SIndefOperatorInfo {
|
|||
} SIndefOperatorInfo;
|
||||
|
||||
static int32_t doGenerateSourceData(SOperatorInfo* pOperator);
|
||||
static SSDataBlock* doProjectOperation1(SOperatorInfo* pOperator);
|
||||
static int32_t doProjectOperation(SOperatorInfo* pOperator, SSDataBlock** pResBlock);
|
||||
static SSDataBlock* doApplyIndefinitFunction1(SOperatorInfo* pOperator);
|
||||
static int32_t doApplyIndefinitFunction(SOperatorInfo* pOperator, SSDataBlock** pResBlock);
|
||||
static int32_t setRowTsColumnOutputInfo(SqlFunctionCtx* pCtx, int32_t numOfCols, SArray** pResList);
|
||||
static int32_t setFunctionResultOutput(SOperatorInfo* pOperator, SOptrBasicInfo* pInfo, SAggSupporter* pSup,
|
||||
|
@ -557,12 +555,6 @@ static void doHandleDataBlock(SOperatorInfo* pOperator, SSDataBlock* pBlock, SOp
|
|||
}
|
||||
}
|
||||
|
||||
SSDataBlock* doApplyIndefinitFunction1(SOperatorInfo* pOperator) {
|
||||
SSDataBlock* pResBlock = NULL;
|
||||
pOperator->pTaskInfo->code = doApplyIndefinitFunction(pOperator, &pResBlock);
|
||||
return pResBlock;
|
||||
}
|
||||
|
||||
int32_t doApplyIndefinitFunction(SOperatorInfo* pOperator, SSDataBlock** pResBlock) {
|
||||
QRY_PARAM_CHECK(pResBlock);
|
||||
SIndefOperatorInfo* pIndefInfo = pOperator->info;
|
||||
|
|
|
@ -5193,7 +5193,7 @@ static int32_t doTagScanFromMetaEntryNext(SOperatorInfo* pOperator, SSDataBlock*
|
|||
setOperatorCompleted(pOperator);
|
||||
}
|
||||
|
||||
// qDebug("QInfo:0x%"PRIx64" create tag values results completed, rows:%d", GET_TASKID(pRuntimeEnv), count);
|
||||
// qDebug("QInfo:0x%" PRIx64 ", create tag values results completed, rows:%d", GET_TASKID(pRuntimeEnv), count);
|
||||
if (pOperator->status == OP_EXEC_DONE) {
|
||||
setTaskStatus(pTaskInfo, TASK_COMPLETED);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue