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

Turn on v2 engine by default #10543

Merged
merged 3 commits into from
Apr 7, 2023

Conversation

xiangfu0
Copy link
Contributor

@xiangfu0 xiangfu0 commented Apr 4, 2023

Turn on v2 engine by default.

  1. Make v2 engine enabled by default
  2. Use dynamic port for broker mailbox port and server mailbox & query runner ports if not specified. This requires updating helix instanceConfig during initialization.
  3. Bump default DataTable version to 4.

Also tested the broker/server restart with dynamic port changes, reflected in helix instance configs.

image

image

@siddharthteotia
Copy link
Contributor

IIRC - default enabling the feature flag will have no impact on existing production queries unless they are also changed to include the query option to use the multi stage query engine ?

@xiangfu0
Copy link
Contributor Author

xiangfu0 commented Apr 4, 2023

IIRC - default enabling the feature flag will have no impact on existing production queries unless they are also changed to include the query option to use the multi stage query engine ?

This is just to start the query engine by default, ofc we will see extra resources utilization (grpc server started/ports open etc).

The normal query path won't go through it unless specifying useMultistageEngine=true in the query option.

@@ -139,13 +138,11 @@ protected Connection getPinotConnection() {

@Override
protected void overrideBrokerConf(PinotConfiguration brokerConf) {
brokerConf.setProperty(CommonConstants.Helix.CONFIG_OF_MULTI_STAGE_ENGINE_ENABLED, true);
brokerConf.setProperty(QueryConfig.KEY_OF_QUERY_RUNNER_PORT, 8421);
Copy link
Contributor

Choose a reason for hiding this comment

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

so we still need these port config? can we check whether it is possible to default dynamic port allocation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those shouldn't matter, let me remove them as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is instance config in helix is using port 0, so workers cannot talk to each other. Need to find the available port first then set it into server config.

@codecov-commenter
Copy link

codecov-commenter commented Apr 4, 2023

Codecov Report

Merging #10543 (a8b222c) into master (f6c6d14) will decrease coverage by 0.01%.
The diff coverage is 53.57%.

@@             Coverage Diff              @@
##             master   #10543      +/-   ##
============================================
- Coverage     70.35%   70.35%   -0.01%     
  Complexity     6464     6464              
============================================
  Files          2103     2103              
  Lines        112769   112792      +23     
  Branches      16981    16988       +7     
============================================
+ Hits          79341    79353      +12     
+ Misses        27877    27863      -14     
- Partials       5551     5576      +25     
Flag Coverage Δ
integration1 24.55% <53.57%> (+0.09%) ⬆️
integration2 24.00% <53.57%> (-0.25%) ⬇️
unittests1 67.84% <100.00%> (+<0.01%) ⬆️
unittests2 13.89% <45.83%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
...core/common/datatable/DataTableBuilderFactory.java 58.82% <ø> (ø)
...va/org/apache/pinot/spi/utils/CommonConstants.java 24.39% <ø> (ø)
...e/pinot/broker/broker/helix/BaseBrokerStarter.java 76.19% <47.61%> (-3.04%) ⬇️
.../pinot/server/starter/helix/BaseServerStarter.java 56.79% <50.00%> (-0.56%) ⬇️
...requesthandler/MultiStageBrokerRequestHandler.java 69.79% <100.00%> (+1.04%) ⬆️
...apache/pinot/common/datatable/DataTableImplV4.java 91.10% <100.00%> (+0.99%) ⬆️

... and 31 files with indirect coverage changes

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

@xiangfu0 xiangfu0 force-pushed the enable-v2-engine-by-default branch 3 times, most recently from 145c20b to 107db8a Compare April 5, 2023 09:45
_serverConf.setProperty(QueryConfig.KEY_OF_QUERY_SERVER_PORT, NetUtils.findOpenPort());
}
if (_serverConf.getProperty(QueryConfig.KEY_OF_QUERY_RUNNER_PORT, QueryConfig.DEFAULT_QUERY_RUNNER_PORT) == 0) {
_serverConf.setProperty(QueryConfig.KEY_OF_QUERY_RUNNER_PORT, NetUtils.findOpenPort());
Copy link
Contributor

Choose a reason for hiding this comment

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

Doing this can have query runner port differ from one worker to another ? In that case, how will they talk to each other ?

Copy link
Contributor

Choose a reason for hiding this comment

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

port configurations are stored in serverInstance and it is backed up to Helix via InstanceConfig

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It comes from the instanceConfig in Helix.

@@ -94,7 +94,6 @@ public String[] getDefaultBatchTableDirectories() {
@Override
public Map<String, Object> getConfigOverrides() {
Map<String, Object> overrides = new HashMap<>(super.getConfigOverrides());
overrides.put("pinot.multistage.engine.enabled", "true");
overrides.put("pinot.server.instance.currentDataTableVersion", 4);
Copy link
Contributor

@ankitsultana ankitsultana Apr 5, 2023

Choose a reason for hiding this comment

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

By default data table version is 3. I think enabling multistage engine alone wouldn't be sufficient since v2 queries will fail with data-table v3.

public static final int DEFAULT_VERSION = DataTableFactory.VERSION_3;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, any idea this doesn't fail on integration test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

datatable version is set to 4 in multistage integration tests

Copy link
Contributor

Choose a reason for hiding this comment

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

@xiangfu0 xiangfu0 force-pushed the enable-v2-engine-by-default branch 3 times, most recently from 6081fa6 to 60a7927 Compare April 5, 2023 21:27
Copy link
Contributor

@walterddr walterddr left a comment

Choose a reason for hiding this comment

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

lgtm. we can also have a restart integration test that basically

  1. start broker/server
  2. tear it down and start them again (in server/broker or broker/server order)
  3. see if they still can query

@walterddr
Copy link
Contributor

test failure seems reproducible in 2 CI runs. can you take a look?

@xiangfu0 xiangfu0 force-pushed the enable-v2-engine-by-default branch from 60a7927 to a7bf88a Compare April 6, 2023 19:10
@xiangfu0 xiangfu0 force-pushed the enable-v2-engine-by-default branch from a7bf88a to a8b222c Compare April 6, 2023 21:51
@xiangfu0
Copy link
Contributor Author

xiangfu0 commented Apr 6, 2023

Modified the V4 DataTable _variableSizeDataBytes to byte[0] instead of null.
This is due to the only value of byte[0] is set, but read as null in deserialize ByteBuffer.

Before serialization
image
After Deserialization
image

@@ -150,15 +150,12 @@ public DataTableImplV4(ByteBuffer byteBuffer)
}

// Read variable size data.
_variableSizeDataBytes = new byte[variableSizeDataLength];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@walterddr Please verify this logic.

Copy link
Contributor

Choose a reason for hiding this comment

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

this should be ok.

@xiangfu0 xiangfu0 merged commit 8eaeb03 into apache:master Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants