[
https://issues.apache.org/jira/browse/CASSANDRA-19412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17819204#comment-17819204
]
Stefan Miklosovic commented on CASSANDRA-19412:
-----------------------------------------------
[CASSANDRA-19412-4.1|https://github.com/instaclustr/cassandra/tree/CASSANDRA-19412-4.1]
{noformat}
java11_pre-commit_tests
java11_separate_tests
java8_pre-commit_tests
✓ j8_build 7m 42s
✓ j8_cqlsh_dtests_py3 8m 52s
✓ j8_cqlsh_dtests_py311 6m 22s
✓ j8_cqlsh_dtests_py311_vnode 5m 59s
✓ j8_cqlsh_dtests_py38 7m 3s
✓ j8_cqlsh_dtests_py38_vnode 9m 10s
✓ j8_cqlsh_dtests_py3_vnode 8m 27s
✓ j8_cqlshlib_cython_tests 9m 23s
✓ j8_cqlshlib_tests 11m 25s
✓ j8_dtests 31m 17s
✓ j8_dtests_vnode 35m 40s
✓ j8_jvm_dtests 15m 47s
✓ j8_jvm_dtests_vnode 12m 31s
✓ j8_simulator_dtests 1m 52s
✓ j11_jvm_dtests_vnode 12m 34s
✓ j11_jvm_dtests 15m 33s
✓ j11_dtests_vnode 36m 49s
✓ j11_dtests 33m 19s
✓ j11_cqlshlib_tests 5m 57s
✓ j11_cqlshlib_cython_tests 6m 36s
✓ j11_cqlsh_dtests_py3_vnode 5m 24s
✓ j11_cqlsh_dtests_py38_vnode 5m 42s
✓ j11_cqlsh_dtests_py38 5m 40s
✓ j11_cqlsh_dtests_py311_vnode 5m 34s
✓ j11_cqlsh_dtests_py311 5m 53s
✓ j11_cqlsh_dtests_py3 5m 18s
✕ j8_unit_tests 10m 53s
org.apache.cassandra.cql3.MemtableSizeTest testSize[skiplist]
✕ j8_utests_system_keyspace_directory 10m 37s
org.apache.cassandra.cql3.MemtableSizeTest testSize[skiplist]
✕ j11_unit_tests 9m 49s
org.apache.cassandra.net.ConnectionTest testTimeout
org.apache.cassandra.cql3.MemtableSizeTest testSize[skiplist]
java8_separate_tests
{noformat}
[java11_pre-commit_tests|https://app.circleci.com/pipelines/github/instaclustr/cassandra/3899/workflows/8f32f197-4fd4-48c8-a68a-bd91de42d4ba]
[java11_separate_tests|https://app.circleci.com/pipelines/github/instaclustr/cassandra/3899/workflows/c18e72df-6393-40c4-b5e0-a02d48b363c9]
[java8_pre-commit_tests|https://app.circleci.com/pipelines/github/instaclustr/cassandra/3899/workflows/915a2c34-3e6d-44a2-baef-9b32c79b2026]
[java8_separate_tests|https://app.circleci.com/pipelines/github/instaclustr/cassandra/3899/workflows/4fcf7df2-fda2-4644-92e2-af0bb2181e55]
> delete useless collection:backPressureHosts in the sendToHintedReplicas to
> improve write performance
> ----------------------------------------------------------------------------------------------------
>
> Key: CASSANDRA-19412
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19412
> Project: Cassandra
> Issue Type: Improvement
> Components: Legacy/Local Write-Read Paths
> Reporter: Ling Mao
> Assignee: Ling Mao
> Priority: Low
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Every normal write request will go through this
> method({_}*sendToHintedReplicas*{_}). However, the list:backPressureHosts in
> the method has never been used functionally.
> The _*backpressure*_ was introduced by:
> {code:java}
> Support optional backpressure strategies at the coordinator
> patch by Sergio Bossa; reviewed by Stefania Alborghetti for CASSANDRA-9318
> d43b9ce5 Sergio Bossa <[email protected]> on 2016/9/19 at 10:42 AM {code}
> {code:java}
> public static void sendToHintedEndpoints(final Mutation mutation,
> Iterable<InetAddress> targets,
>
> AbstractWriteResponseHandler<IMutation> responseHandler,
> String localDataCenter,
> Stage stage)
> throws OverloadedException
> {
> int targetsSize = Iterables.size(targets);
> // this dc replicas:
> Collection<InetAddress> localDc = null;
> // extra-datacenter replicas, grouped by dc
> Map<String, Collection<InetAddress>> dcGroups = null;
> // only need to create a Message for non-local writes
> MessageOut<Mutation> message = null;
> boolean insertLocal = false;
> ArrayList<InetAddress> endpointsToHint = null;
> List<InetAddress> backPressureHosts = null;
> for (InetAddress destination : targets)
> {
> checkHintOverload(destination);
> if (FailureDetector.instance.isAlive(destination))
> {
> if (canDoLocalRequest(destination))
> {
> insertLocal = true;
> }
> else
> {
> // belongs on a different server
> if (message == null)
> message = mutation.createMessage();
> String dc =
> DatabaseDescriptor.getEndpointSnitch().getDatacenter(destination);
> // direct writes to local DC or old Cassandra versions
> // (1.1 knows how to forward old-style String message
> IDs; updated to int in 2.0)
> if (localDataCenter.equals(dc))
> {
> if (localDc == null)
> localDc = new ArrayList<>(targetsSize);
> localDc.add(destination);
> }
> else
> {
> Collection<InetAddress> messages = (dcGroups != null)
> ? dcGroups.get(dc) : null;
> if (messages == null)
> {
> messages = new ArrayList<>(3); // most DCs will
> have <= 3 replicas
> if (dcGroups == null)
> dcGroups = new HashMap<>();
> dcGroups.put(dc, messages);
> }
> messages.add(destination);
> }
> if (backPressureHosts == null)
> backPressureHosts = new ArrayList<>(targetsSize);
> backPressureHosts.add(destination);
> }
> }
> else
> {
> if (shouldHint(destination))
> {
> if (endpointsToHint == null)
> endpointsToHint = new ArrayList<>(targetsSize);
> endpointsToHint.add(destination);
> }
> }
> }
> if (backPressureHosts != null)
> MessagingService.instance().applyBackPressure(backPressureHosts,
> responseHandler.currentTimeout());
> if (endpointsToHint != null)
> submitHint(mutation, endpointsToHint, responseHandler);
> if (insertLocal)
> performLocally(stage, Optional.of(mutation), mutation::apply,
> responseHandler);
> if (localDc != null)
> {
> for (InetAddress destination : localDc)
> MessagingService.instance().sendRR(message, destination,
> responseHandler, true);
> }
> if (dcGroups != null)
> {
> // for each datacenter, send the message to one node to relay the
> write to other replicas
> for (Collection<InetAddress> dcTargets : dcGroups.values())
> sendMessagesToNonlocalDC(message, dcTargets, responseHandler);
> }
> } {code}
> Now the backPressure related codes had been deleted in the codebase, and here
> maybe someone forgot to remove the collection: backPressureHosts. Removing it
> will save every write request to add a few items to a list to reduce the
> memory footprint
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]