Skip to content

Add the cn-service - #4535

Merged
mergify[bot] merged 16 commits into
matrixorigin:mainfrom
daviszhen:0816-cn-service
Aug 17, 2022
Merged

mergify[bot] merged 16 commits into
matrixorigin:mainfrom
daviszhen:0816-cn-service

Conversation

@daviszhen

@daviszhen daviszhen commented Aug 16, 2022 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #

What this PR does / why we need it:

  1. Connect the cn-service with the frontend and the computation engine.
  2. Change the configuraion mechanism to the general method. Remove the auto-generated configuration.

@matrix-meow matrix-meow added the size/XXL Denotes a PR that changes 2000+ lines label Aug 16, 2022
@mergify mergify Bot added the kind/tech-request New feature or request label Aug 16, 2022
@daviszhen
daviszhen requested a review from jianwan0214 August 16, 2022 12:25
Comment thread etc/cn-minimal-test.toml Outdated
format = "json"
max-size = 512

[cn.frontend]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default configuration needs to be removed from the configuration to keep it simple, and the default value is set inside the code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default configuration needs to be removed from the configuration to keep it simple, and the default value is set inside the code

I will remove the parameters using the default value

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend comment out optional configuration items, so that users can easily inspect all the configuration items and default values in one place while we still keep the minimal configuration simple.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you like? @zhangxu19830126 @daviszhen

@aylei aylei Aug 17, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we don't need a full test toml in etc if we do so. (maybe we still need a full one in bvt to verify all the configuration items are working)

@sukki37 sukki37 Aug 17, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need the rule to classify those configured parameters into:

  • parameters can be modified by users(need to expose to users by default)
  • parameters can but are not recommended for modification
  • parameters cannot be modified by the user, like rootname...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, better to remove all these parameters used by the internal modules, like processLimitationSize, portOfRpcServerInComputationEngine and etc. I don't think users need to know them at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you like? @zhangxu19830126 @daviszhen
I keep all the parameters of the frontend with the default values and remove them from the cn-minimal

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we don't need a full test toml in etc if we do so. (maybe we still need a full one in bvt to verify all the configuration items are working)

I remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, better to remove all these parameters used by the internal modules, like processLimitationSize, portOfRpcServerInComputationEngine and etc. I don't think users need to know them at all.

I remove them.

Comment thread pkg/cnservice/server.go Outdated
)

func NewService(cfg *Config) (Service, error) {
var (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove to mo-service/version.go

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add a configuration item to transfer the MOVersion from the mo-service to the cn-service away from the circular reference

@lni

lni commented Aug 16, 2022

Copy link
Copy Markdown
Contributor

@daviszhen will talk later this week on how to setup HAKeeper client in CN Service for heartbeating and querying cluster details (get how many CN/DN nodes are in the system).

@fengttt fengttt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change related to system variables and session variables?

@daviszhen

Copy link
Copy Markdown
Contributor Author

@daviszhen will talk later this week on how to setup HAKeeper client in CN Service for heartbeating and querying cluster details (get how many CN/DN nodes are in the system).

Yesterday @fengttt advised that @zhangxu19830126 to setup the CN service store involved with HAKeeper.
Also, @reusee suggested me to merge the pr first. He will add the txn client part based on this pr.

Comment thread etc/cn-minimal-test.toml Outdated
processLimitationPartitionRows = 42949672960

#record the time elapsed of executing sql request
recordTimeElapsedOfSqlRequest = true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove from the toml config. Init with default value in the code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also add a 'cn-full-test.toml' with all parameters with default values.

Comment thread etc/cn-minimal-test.toml Outdated
traceBatchProcessor = "InternalExecutor"

#With true, system will check all the children span is ended, which belong to the closing span.
enableTraceDebug = false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove from the minimal toml config

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove it .

Comment thread etc/cn-minimal-test.toml Outdated
logFilename = ""

#MB. the maximum of log file size
logMaxSize = 512 No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configuration of the log is duplicated, and the initialization of the log should not belong to CN

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove the duplicate one.

Comment thread etc/cn-full-test.toml Outdated
mempoolFactor = 8

#process.Limitation.Size. 10 << 32 = 42949672960
processLimitationSize = 42949672960

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not really necessary to expose this information, you can get the machine's resource information at startup and calculate a reasonable value

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remove it

@mergify
mergify Bot merged commit c524168 into matrixorigin:main Aug 17, 2022
@wanglei4687 wanglei4687 mentioned this pull request Aug 18, 2022
1 of 7 tasks
mergify Bot pushed a commit that referenced this pull request Aug 18, 2022
1. cago compiler with link system lib, so  ignore cgo generate files
`/usr/bin/ld` is my local Apple's linker

For example:
```
#16 52.59 # github.com/matrixorigin/matrixone/cmd/db-server
#16 52.59 /usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
#16 52.59 /usr/bin/ld: /tmp/go-link-2126209758/000006.o: in function `_cgo_df8c56550131_Cfunc_Decimal128_Add':
#16 52.59 decimal.cgo2.c:(.text+0x71): undefined reference to `Decimal128_Add'
#16 52.59 /usr/bin/ld: /tmp/go-link-2126209758/000006.o: in function `_cgo_df8c56550131_Cfunc_Decimal128_AddDecimal64':
#16 52.59 decimal.cgo2.c:(.text+0xcd): undefined reference to `Decimal128_AddDecimal64'
#16 52.59 /usr/bin/ld: /tmp/go-link-2126209758/000006.o: in function `_cgo_df8c56550131_Cfunc_Decimal128_AddInt64':
```

2. According to #4535, the `system_vars_config.toml` will be the default config and  `make config` do not generate configuration files. So `system_vars_config.toml` should not be ignored. It's related to [optools/images/Dockerfile](https://github.com/matrixorigin/matrixone/blob/main/optools/images/Dockerfile)

3. Add some other generate files, like `gen_config` and ignore generate data at `store/`.

4. Fix config error

Approved by: @yingfeng
fengttt pushed a commit to fengttt/matrixone that referenced this pull request May 7, 2026
1. Connect the cn-service with the frontend and the computation engine.
2. Change the configuraion mechanism to the general method. Remove the auto-generated configuration.

Approved by: @zhangxu19830126, @yingfeng, @fengttt, @aptend, @reusee, @nnsgmsone, @lni
fengttt pushed a commit to fengttt/matrixone that referenced this pull request May 7, 2026
1. cago compiler with link system lib, so  ignore cgo generate files
`/usr/bin/ld` is my local Apple's linker

For example:
```
#16 52.59 # github.com/matrixorigin/matrixone/cmd/db-server
#16 52.59 /usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
#16 52.59 /usr/bin/ld: /tmp/go-link-2126209758/000006.o: in function `_cgo_df8c56550131_Cfunc_Decimal128_Add':
#16 52.59 decimal.cgo2.c:(.text+0x71): undefined reference to `Decimal128_Add'
#16 52.59 /usr/bin/ld: /tmp/go-link-2126209758/000006.o: in function `_cgo_df8c56550131_Cfunc_Decimal128_AddDecimal64':
#16 52.59 decimal.cgo2.c:(.text+0xcd): undefined reference to `Decimal128_AddDecimal64'
#16 52.59 /usr/bin/ld: /tmp/go-link-2126209758/000006.o: in function `_cgo_df8c56550131_Cfunc_Decimal128_AddInt64':
```

2. According to matrixorigin#4535, the `system_vars_config.toml` will be the default config and  `make config` do not generate configuration files. So `system_vars_config.toml` should not be ignored. It's related to [optools/images/Dockerfile](https://github.com/matrixorigin/matrixone/blob/main/optools/images/Dockerfile)

3. Add some other generate files, like `gen_config` and ignore generate data at `store/`.

4. Fix config error

Approved by: @yingfeng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/tech-request New feature or request size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.