Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

chore: collect static log features to a separate feature #5725

Merged
merged 8 commits into from
Oct 10, 2022
Merged

Conversation

MrCroxx
Copy link
Contributor

@MrCroxx MrCroxx commented Oct 9, 2022

I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.

What's changed and what's your intention?

As titled. More discussion: #5721 .

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Refer to a related PR or issue link (optional)

close #5721

@MrCroxx
Copy link
Contributor Author

MrCroxx commented Oct 9, 2022

Or we can combine static-link and static-log-level into one crate called dist later.

Copy link
Member

@BugenZhao BugenZhao left a comment

Choose a reason for hiding this comment

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

❤️

// See the License for the specific language governing permissions and
// limitations under the License.

//! This crate is used to control static log level.
Copy link
Member

Choose a reason for hiding this comment

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

To avoid forgetting to enable the static log level in release build, how about adding a compile-time check like this?

#[cfg(all(not(feature = "enabled"), not(debug_assertions)))]
compile_error!("must enable `static-log-level` in release build with `--features static-log-level`")

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer moving static-log-level and static-link in a single crate. e.g. workspace-config with enable-static-link and enable-log-level feature.

Cargo.lock Outdated
@@ -1969,9 +1969,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"

[[package]]
name = "futures"
version = "0.3.24"
version = "0.3.23"
Copy link
Member

Choose a reason for hiding this comment

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

Please revert this as there's a bug in 0.3.23. 🤣 #5657 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

The scaling test will fail with 0.3.23

@BugenZhao BugenZhao requested a review from skyzh October 9, 2022 07:08
Copy link
Contributor

@skyzh skyzh left a comment

Choose a reason for hiding this comment

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

LGTM. Let's see if we can make things easier after we upgrade the toolchain and use workspace inheritance in the future.

// See the License for the specific language governing permissions and
// limitations under the License.

//! This crate is used to control static log level.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer moving static-log-level and static-link in a single crate. e.g. workspace-config with enable-static-link and enable-log-level feature.

@MrCroxx MrCroxx marked this pull request as ready for review October 10, 2022 06:15
@MrCroxx
Copy link
Contributor Author

MrCroxx commented Oct 10, 2022

@BugenZhao What about now?

@BugenZhao
Copy link
Member

LGTM. How about introducing the compile_error check?

@MrCroxx
Copy link
Contributor Author

MrCroxx commented Oct 10, 2022

LGTM. How about introducing the compile_error check?

Oh, I forgot it. Let me add it. 😀

Copy link
Contributor

@skyzh skyzh left a comment

Choose a reason for hiding this comment

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

Rest LGTM, good work!

@@ -13,3 +13,13 @@
// limitations under the License.

//! This crate includes dependencies that need to be statically-linked.
#[cfg(all(
Copy link
Contributor

Choose a reason for hiding this comment

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

The magic of attribute combination 🤣

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤣

Cargo.lock Outdated
@@ -6708,9 +6708,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"

[[package]]
name = "unicode-ident"
version = "1.0.4"
version = "1.0.3"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you please revert unrelated changes in Cargo.lock? Several crates have been downgraded.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'm working on it~

@MrCroxx MrCroxx self-assigned this Oct 10, 2022
@MrCroxx MrCroxx added the mergify/can-merge Indicates that the PR can be added to the merge queue label Oct 10, 2022
@codecov
Copy link

codecov bot commented Oct 10, 2022

Codecov Report

Merging #5725 (9f9cbee) into main (b0fb507) will increase coverage by 0.00%.
The diff coverage is 87.80%.

❗ Current head 9f9cbee differs from pull request most recent head 975c40d. Consider uploading reports for the commit 975c40d to get more accurate results

@@           Coverage Diff            @@
##             main    #5725    +/-   ##
========================================
  Coverage   75.07%   75.07%            
========================================
  Files         912      912            
  Lines      142660   142530   -130     
========================================
- Hits       107098   107011    -87     
+ Misses      35562    35519    -43     
Flag Coverage Δ
rust 75.07% <87.80%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/meta/src/rpc/server.rs 80.21% <ø> (-0.21%) ⬇️
src/meta/src/stream/source_manager.rs 31.36% <ø> (+1.12%) ⬆️
src/meta/src/stream/stream_manager.rs 71.15% <ø> (-0.07%) ⬇️
src/stream/src/from_proto/merge.rs 0.00% <0.00%> (ø)
src/stream/src/task/stream_manager.rs 2.75% <0.00%> (+<0.01%) ⬆️
src/utils/workspace-config/src/lib.rs 100.00% <ø> (ø)
src/meta/src/hummock/manager/mod.rs 79.09% <50.00%> (-0.16%) ⬇️
src/meta/src/manager/id.rs 93.36% <92.59%> (-0.12%) ⬇️
src/meta/src/hummock/compaction_group/manager.rs 90.38% <95.23%> (+0.53%) ⬆️
src/meta/src/manager/cluster.rs 77.30% <100.00%> (ø)
... and 13 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mergify mergify bot merged commit 7678927 into main Oct 10, 2022
@mergify mergify bot deleted the xx/log-level branch October 10, 2022 07:16
@StrikeW
Copy link
Contributor

StrikeW commented Oct 12, 2022

It seems that the DEBUG log of aws_config::meta::credentials::lazy_caching in the release build doesn't suppress after this PR. Have you ever try to run the cluster and see the log output? cc @MrCroxx

./risedev configure to set the release build then start the cluster with ./risedev d full (use aws-s3 instead of minio). And debug log of aws_config still shows up.
compactor log:

2022-10-12T03:23:15.535807Z DEBUG send_operation:provide_credentials: aws_config::meta::credentials::lazy_caching: loaded credentials from cache operation="PutObject" service="s3" provider=default_chain
2022-10-12T03:23:15.784546Z DEBUG send_operation:provide_credentials: aws_config::meta::credentials::lazy_caching: loaded credentials from cache operation="PutObject" service="s3" provider=default_chain
2022-10-12T03:23:15.955515Z DEBUG send_operation:provide_credentials: aws_config::meta::credentials::lazy_caching: loaded credentials from cache operation="PutObject" service="s3" provider=default_chain
2022-10-12T03:23:16.341963Z  INFO risingwave_storage::hummock::compactor: Finished compaction task in 1126.990332ms:
Compaction task id: 9, target level: 0
Compaction watermark: 3165976256512000
Compaction target_file_size: 33554432
Compaction # splits: 1
Compaction task status: 2
Compaction Sstables structure:
Level 0 ["[id: 50, 9114KB]"]
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergify/can-merge Indicates that the PR can be added to the merge queue type/chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dev: collect all tracing *_max_level_* features into a separate feature
4 participants