This is an automated email from the ASF dual-hosted git repository. av pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push: new 89e36170999 IGNITE-21087 Remove VacuumTask, MvccQueryTracker and MvccLongList (#11273) 89e36170999 is described below commit 89e36170999986ee01c8507352ff2f97fac6aaab Author: Julia Bakulina <96814257+j-bak...@users.noreply.github.com> AuthorDate: Wed Mar 20 17:04:11 2024 +0300 IGNITE-21087 Remove VacuumTask, MvccQueryTracker and MvccLongList (#11273) --- .../ignite/configuration/IgniteConfiguration.java | 69 ------- .../dht/colocated/GridDhtColocatedCache.java | 33 ---- .../cache/mvcc/MvccCoordinatorChangeAware.java | 45 ----- .../processors/cache/mvcc/MvccEmptyLongList.java | 53 ------ .../processors/cache/mvcc/MvccLongList.java | 32 ---- .../processors/cache/mvcc/MvccQueryTracker.java | 62 ------ .../cache/mvcc/MvccQueryTrackerImpl.java | 212 --------------------- .../processors/cache/mvcc/MvccSnapshot.java | 5 - .../cache/mvcc/MvccSnapshotWithoutTxs.java | 5 - .../internal/processors/cache/mvcc/MvccUtils.java | 27 --- .../processors/cache/mvcc/PreviousQueries.java | 187 ------------------ .../cache/mvcc/StaticMvccQueryTracker.java | 70 ------- .../processors/cache/mvcc/VacuumMetrics.java | 101 ---------- .../cache/mvcc/VacuumMetricsReducer.java | 49 ----- .../internal/processors/cache/mvcc/VacuumTask.java | 63 ------ .../cache/query/GridCacheQueryAdapter.java | 98 +--------- .../platform/utils/PlatformConfigurationUtils.java | 8 - .../main/resources/META-INF/classnames.properties | 1 - .../processors/query/h2/H2FieldsIterator.java | 10 - .../processors/query/h2/IgniteH2Indexing.java | 2 - .../query/h2/twostep/GridReduceQueryExecutor.java | 17 +- .../query/h2/twostep/ReduceIndexIterator.java | 9 +- .../Config/full-config.xml | 2 +- .../IgniteConfigurationSerializerTest.cs | 2 - .../IgniteConfigurationTest.cs | 6 - .../Apache.Ignite.Core/IgniteConfiguration.cs | 46 ----- .../IgniteConfigurationSection.xsd | 10 - 27 files changed, 5 insertions(+), 1219 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java index 5316883163d..abaa32f90f5 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java @@ -53,7 +53,6 @@ import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteAsyncCallback; -import org.apache.ignite.lang.IgniteExperimental; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.lang.IgnitePredicate; import org.apache.ignite.lifecycle.LifecycleBean; @@ -265,12 +264,6 @@ public class IgniteConfiguration { @Deprecated public static final long DFLT_LONG_QRY_WARN_TIMEOUT = SqlConfiguration.DFLT_LONG_QRY_WARN_TIMEOUT; - /** Default number of MVCC vacuum threads.. */ - public static final int DFLT_MVCC_VACUUM_THREAD_CNT = 2; - - /** Default time interval between MVCC vacuum runs in milliseconds. */ - public static final long DFLT_MVCC_VACUUM_FREQUENCY = 5000; - /** * Default SQL query history size. * @@ -591,12 +584,6 @@ public class IgniteConfiguration { /** Client connector configuration. */ private ClientConnectorConfiguration cliConnCfg = ClientListenerProcessor.DFLT_CLI_CFG; - /** Size of MVCC vacuum thread pool. */ - private int mvccVacuumThreadCnt = DFLT_MVCC_VACUUM_THREAD_CNT; - - /** Time interval between vacuum runs (ms). */ - private long mvccVacuumFreq = DFLT_MVCC_VACUUM_FREQUENCY; - /** User authentication enabled. */ private boolean authEnabled; @@ -700,8 +687,6 @@ public class IgniteConfiguration { metricsLogFreq = cfg.getMetricsLogFrequency(); metricsUpdateFreq = cfg.getMetricsUpdateFrequency(); mgmtPoolSize = cfg.getManagementThreadPoolSize(); - mvccVacuumThreadCnt = cfg.getMvccVacuumThreadCount(); - mvccVacuumFreq = cfg.getMvccVacuumFrequency(); netTimeout = cfg.getNetworkTimeout(); nodeId = cfg.getNodeId(); odbcCfg = cfg.getOdbcConfiguration(); @@ -3483,60 +3468,6 @@ public class IgniteConfiguration { return cliConnCfg; } - /** - * <b>This is an experimental feature. Transactional SQL is currently in a beta status.</b> - * <p> - * Returns number of MVCC vacuum threads. - * - * @return Number of MVCC vacuum threads. - */ - @IgniteExperimental - public int getMvccVacuumThreadCount() { - return mvccVacuumThreadCnt; - } - - /** - * <b>This is an experimental feature. Transactional SQL is currently in a beta status.</b> - * <p> - * Sets number of MVCC vacuum threads. - * - * @param mvccVacuumThreadCnt Number of MVCC vacuum threads. - * @return {@code this} for chaining. - */ - @IgniteExperimental - public IgniteConfiguration setMvccVacuumThreadCount(int mvccVacuumThreadCnt) { - this.mvccVacuumThreadCnt = mvccVacuumThreadCnt; - - return this; - } - - /** - * <b>This is an experimental feature. Transactional SQL is currently in a beta status.</b> - * <p> - * Returns time interval between MVCC vacuum runs in milliseconds. - * - * @return Time interval between MVCC vacuum runs in milliseconds. - */ - @IgniteExperimental - public long getMvccVacuumFrequency() { - return mvccVacuumFreq; - } - - /** - * <b>This is an experimental feature. Transactional SQL is currently in a beta status.</b> - * <p> - * Sets time interval between MVCC vacuum runs in milliseconds. - * - * @param mvccVacuumFreq Time interval between MVCC vacuum runs in milliseconds. - * @return {@code this} for chaining. - */ - @IgniteExperimental - public IgniteConfiguration setMvccVacuumFrequency(long mvccVacuumFreq) { - this.mvccVacuumFreq = mvccVacuumFreq; - - return this; - } - /** * Returns {@code true} if user authentication is enabled for cluster. Otherwise returns {@code false}. * Default value is false; authentication is disabled. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java index 64d2b02bf2d..f3b6e5dc010 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java @@ -61,7 +61,6 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTran import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal; import org.apache.ignite.internal.processors.cache.distributed.near.GridNearUnlockRequest; import org.apache.ignite.internal.processors.cache.distributed.near.consistency.GridNearReadRepairCheckOnlyFuture; -import org.apache.ignite.internal.processors.cache.mvcc.MvccQueryTracker; import org.apache.ignite.internal.processors.cache.mvcc.MvccSnapshot; import org.apache.ignite.internal.processors.cache.persistence.CacheDataRow; import org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey; @@ -71,7 +70,6 @@ import org.apache.ignite.internal.util.future.GridEmbeddedFuture; import org.apache.ignite.internal.util.future.GridFinishedFuture; import org.apache.ignite.internal.util.lang.IgnitePair; import org.apache.ignite.internal.util.typedef.C2; -import org.apache.ignite.internal.util.typedef.CI1; import org.apache.ignite.internal.util.typedef.CI2; import org.apache.ignite.internal.util.typedef.CX1; import org.apache.ignite.internal.util.typedef.F; @@ -234,14 +232,10 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte }, opCtx, /*retry*/false); } - MvccQueryTracker mvccTracker = null; - AffinityTopologyVersion topVer; if (tx != null) topVer = tx.topologyVersion(); - else if (mvccTracker != null) - topVer = mvccTracker.topologyVersion(); else topVer = ctx.affinity().affinityTopologyVersion(); @@ -279,17 +273,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte fut.init(); - if (mvccTracker != null) { - final MvccQueryTracker mvccTracker0 = mvccTracker; - - fut.listen(new CI1<IgniteInternalFuture<Object>>() { - @Override public void apply(IgniteInternalFuture<Object> future) { - if (future.isDone()) - mvccTracker0.onDone(); - } - }); - } - return (IgniteInternalFuture<V>)fut; } @@ -335,14 +318,10 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte }, opCtx, /*retry*/false); } - MvccQueryTracker mvccTracker = null; - AffinityTopologyVersion topVer; if (tx != null) topVer = tx.topologyVersion(); - else if (mvccTracker != null) - topVer = mvccTracker.topologyVersion(); else topVer = ctx.affinity().affinityTopologyVersion(); @@ -379,18 +358,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte null ); - if (mvccTracker != null) { - final MvccQueryTracker mvccTracker0 = mvccTracker; - - fut.listen(new CI1<IgniteInternalFuture<Map<K, V>>>() { - /** {@inheritDoc} */ - @Override public void apply(IgniteInternalFuture<Map<K, V>> future) { - if (future.isDone()) - mvccTracker0.onDone(); - } - }); - } - return fut; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccCoordinatorChangeAware.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccCoordinatorChangeAware.java deleted file mode 100644 index 36e6a380996..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccCoordinatorChangeAware.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache.mvcc; - -import java.util.concurrent.atomic.AtomicLong; -import java.util.function.LongPredicate; - -/** - * - */ -public interface MvccCoordinatorChangeAware { - /** */ - AtomicLong ID_CNTR = new AtomicLong(); - - /** */ - long MVCC_TRACKER_ID_NA = -1; - - /** */ - LongPredicate ID_FILTER = id -> id != MVCC_TRACKER_ID_NA; - - /** - * Mvcc coordinator change callback. - * - * @param newCrd New mvcc coordinator. - * @return Query id if exists. - */ - default long onMvccCoordinatorChange(MvccCoordinator newCrd) { - return MVCC_TRACKER_ID_NA; - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccEmptyLongList.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccEmptyLongList.java deleted file mode 100644 index 7963685ec6d..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccEmptyLongList.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache.mvcc; - -/** - * - */ -public class MvccEmptyLongList implements MvccLongList { - /** */ - public static MvccEmptyLongList INSTANCE = new MvccEmptyLongList(); - - /** - * - */ - private MvccEmptyLongList() { - // No-op. - } - - /** {@inheritDoc} */ - @Override public int size() { - return 0; - } - - /** {@inheritDoc} */ - @Override public long get(int i) { - throw new IndexOutOfBoundsException(); - } - - /** {@inheritDoc} */ - @Override public boolean contains(long val) { - return false; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return "MvccEmptyLongList[]"; - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccLongList.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccLongList.java deleted file mode 100644 index c10c2b95447..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccLongList.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache.mvcc; - -/** - * - */ -public interface MvccLongList { - /** */ - public int size(); - - /** */ - public long get(int i); - - /** */ - public boolean contains(long val); -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccQueryTracker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccQueryTracker.java deleted file mode 100644 index c362e9aa613..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccQueryTracker.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache.mvcc; - -import org.apache.ignite.internal.IgniteInternalFuture; -import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; -import org.apache.ignite.internal.processors.cache.GridCacheContext; - -/** - * Mvcc tracker. - */ -public interface MvccQueryTracker extends MvccCoordinatorChangeAware { - /** - * @return Tracker id. - */ - default long id() { - return MVCC_TRACKER_ID_NA; - } - - /** - * @return Requested MVCC snapshot. - */ - public MvccSnapshot snapshot(); - - /** - * @return Cache context. - */ - public GridCacheContext context(); - - /** - * @return Topology version. - */ - public AffinityTopologyVersion topologyVersion(); - - /** - * Requests version on coordinator. - * - * @return Future to wait for result. - */ - public IgniteInternalFuture<MvccSnapshot> requestSnapshot(); - - /** - * Marks tracker as done. - */ - public void onDone(); - -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccQueryTrackerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccQueryTrackerImpl.java deleted file mode 100644 index b879972b12a..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccQueryTrackerImpl.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache.mvcc; - -import org.apache.ignite.IgniteCheckedException; -import org.apache.ignite.internal.IgniteInternalFuture; -import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException; -import org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException; -import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; -import org.apache.ignite.internal.processors.cache.GridCacheContext; -import org.apache.ignite.internal.util.future.GridFinishedFuture; -import org.apache.ignite.internal.util.tostring.GridToStringExclude; -import org.apache.ignite.internal.util.typedef.internal.S; -import org.jetbrains.annotations.NotNull; - -/** - * Tracker used for an optimistic tx and not-in-tx queries. - */ -@SuppressWarnings("unchecked") -public class MvccQueryTrackerImpl implements MvccQueryTracker { - /** */ - @GridToStringExclude - private final GridCacheContext cctx; - - /** */ - private long crdVer; - - /** */ - private final long id; - - /** */ - private Object state; - - /** */ - private volatile AffinityTopologyVersion topVer; - - /** */ - private boolean done; - - /** - * @param cctx Cache context. - */ - public MvccQueryTrackerImpl(GridCacheContext cctx) { - this.cctx = cctx; - this.id = ID_CNTR.incrementAndGet(); - } - - /** {@inheritDoc} */ - @Override public long id() { - return id; - } - - /** {@inheritDoc} */ - @Override public MvccSnapshot snapshot() { - Object state0; - - synchronized (this) { - state0 = state; - } - - return snapshot(state0); - } - - /** */ - private MvccSnapshot snapshot(Object state) { - if (state != null && state.getClass() == SnapshotFuture.class) - return ((SnapshotFuture)state).result(); - else - return (MvccSnapshot)state; - } - - /** {@inheritDoc} */ - @Override public GridCacheContext context() { - return cctx; - } - - /** {@inheritDoc} */ - @Override public AffinityTopologyVersion topologyVersion() { - return topVer; - } - - /** {@inheritDoc} */ - @Override public IgniteInternalFuture<MvccSnapshot> requestSnapshot() { - SnapshotFuture fut; - - synchronized (this) { - if (state == null) - state = fut = new SnapshotFuture(); - else if (state.getClass() == SnapshotFuture.class) - return (IgniteInternalFuture<MvccSnapshot>)state; - else - return new GridFinishedFuture<>((MvccSnapshot)state); - } - - return fut; - } - - /** {@inheritDoc} */ - @Override public void onDone() { - Object state0; - - synchronized (this) { - if (done) - return; - - state0 = state; - done = true; - } - - if (state0 != null && state0.getClass() == SnapshotFuture.class) - ((SnapshotFuture)state0).cancel(); - } - - /** {@inheritDoc} */ - @Override public synchronized long onMvccCoordinatorChange(@NotNull MvccCoordinator newCrd) { - if (snapshot(state) != null) { - assert crdVer != 0 : this; - - if (crdVer != newCrd.version()) { - crdVer = newCrd.version(); - - return id; - } - else - return MVCC_TRACKER_ID_NA; - } - else if (crdVer != 0) - crdVer = 0; // Mark for remap. - - return MVCC_TRACKER_ID_NA; - } - - /** - * @param res Response. - * @param lsnr Response listener. - * @return {@code false} if need to remap. - */ - private boolean onResponse0(@NotNull MvccSnapshot res, @NotNull MvccSnapshotResponseListener lsnr) { - synchronized (this) { - assert snapshot(state) == null : "[this=" + this + ", rcvdVer=" + res + "]"; - - if (!done && crdVer != 0) { - this.state = res; - - return true; - } - } - - return false; - } - - /** - * @param e Exception. - * @param lsnr Response listener. - * @return {@code false} if need to remap. - */ - private boolean onError0(IgniteCheckedException e, @NotNull MvccSnapshotResponseListener lsnr) { - synchronized (this) { - if (done) - return false; - } - - if (e instanceof ClusterTopologyCheckedException - && !(e instanceof ClusterTopologyServerNotFoundException)) - return false; - - return true; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(MvccQueryTrackerImpl.class, this); - } - - /** */ - private final class SnapshotFuture extends MvccSnapshotFuture { - /** */ - private SnapshotFuture() {} - - /** {@inheritDoc} */ - @Override public void onResponse(MvccSnapshot res) { - if (onResponse0(res, this)) - super.onResponse(res); - } - - /** {@inheritDoc} */ - @Override public void onError(IgniteCheckedException e) { - if (onError0(e, this)) - super.onError(e); - } - - /** {@inheritDoc} */ - @Override public boolean cancel() { - return onCancelled(); - } - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccSnapshot.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccSnapshot.java index 5ed743a5098..8dac3314dda 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccSnapshot.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccSnapshot.java @@ -26,11 +26,6 @@ import org.apache.ignite.plugin.extensions.communication.Message; * - Cleanup version which is used to help vacuum process. */ public interface MvccSnapshot extends MvccVersion, Message { - /** - * @return Active transactions. - */ - public MvccLongList activeTransactions(); - /** * @return Cleanup version (all smaller versions are safe to remove). */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccSnapshotWithoutTxs.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccSnapshotWithoutTxs.java index 5be631739fe..3e75cd7bdef 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccSnapshotWithoutTxs.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccSnapshotWithoutTxs.java @@ -61,11 +61,6 @@ public class MvccSnapshotWithoutTxs implements MvccSnapshot { this.opCntr = opCntr; } - /** {@inheritDoc} */ - @Override public MvccLongList activeTransactions() { - return MvccEmptyLongList.INSTANCE; - } - /** {@inheritDoc} */ @Override public long coordinatorVersion() { return crdVer; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccUtils.java index 387e97edbec..661af6cf71d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccUtils.java @@ -33,7 +33,6 @@ import org.apache.ignite.internal.transactions.IgniteTxUnexpectedStateCheckedExc import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.transactions.TransactionState; import org.apache.ignite.transactions.TransactionUnsupportedConcurrencyException; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; @@ -237,9 +236,6 @@ public class MvccUtils { return opCntr < snapshotOpCntr; // we don't see own pending updates } - if (snapshot.activeTransactions().contains(mvccCntr)) // we don't see of other transactions' pending updates - return false; - if (!useTxLog) return true; // The checking row is expected to be committed. @@ -693,29 +689,6 @@ public class MvccUtils { return tx; } - /** - * Initialises MVCC filter and returns MVCC query tracker if needed. - * @param cctx Cache context. - * @param tx Transaction. - * @return MVCC query tracker. - * @throws IgniteCheckedException If failed. - */ - @NotNull public static MvccQueryTracker mvccTracker(GridCacheContext cctx, - GridNearTxLocal tx) throws IgniteCheckedException { - MvccQueryTracker tracker; - - if (tx == null) - tracker = new MvccQueryTrackerImpl(cctx); - else - tracker = new StaticMvccQueryTracker(cctx, null); - - if (tracker.snapshot() == null) - // TODO IGNITE-7388 - tracker.requestSnapshot().get(); - - return tracker; - } - /** */ private static MvccVersion mvccVersion(long crd, long cntr, int opCntr) { return new MvccVersionImpl(crd, cntr, opCntr); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/PreviousQueries.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/PreviousQueries.java deleted file mode 100644 index 65893fdae80..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/PreviousQueries.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache.mvcc; - -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import java.util.function.Predicate; -import org.apache.ignite.cluster.ClusterNode; -import org.apache.ignite.internal.util.GridLongList; -import org.apache.ignite.internal.util.tostring.GridToStringInclude; -import org.apache.ignite.internal.util.typedef.internal.S; -import org.jetbrains.annotations.NotNull; - -/** - * - */ -class PreviousQueries { - /** */ - private static class Node { - /** */ - @GridToStringInclude - boolean init; - - /** */ - @GridToStringInclude - Set<Long> cntrs; - - /** */ - boolean isDone() { - return init && (cntrs == null || cntrs.stream().allMatch(l -> l < 0)); - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(Node.class, this); - } - } - - /** */ - private Map<UUID, Node> active = new HashMap<>(); - - /** */ - private boolean init; - - /** */ - private volatile boolean done; - - /** - * @param nodes Waiting nodes. - * @param alivePredicate Alive nodes filter. - */ - synchronized void init(Collection<ClusterNode> nodes, Predicate<UUID> alivePredicate) { - assert !init && !done; - - nodes.stream().map(ClusterNode::id).forEach(uuid -> active.putIfAbsent(uuid, new Node())); - - active.entrySet().removeIf(e -> !alivePredicate.test(e.getKey()) || e.getValue().isDone()); - - if (active.isEmpty()) - done = true; - - init = true; - } - - /** - * @param nodeId Node ID. - */ - void onNodeFailed(@NotNull UUID nodeId) { - if (done()) - return; - - synchronized (this) { - if (init) - removeAndCheckDone(nodeId); - } - } - - /** - * @param nodeId Node ID. - * @param qryId Query tracker Id. - */ - void onQueryDone(@NotNull UUID nodeId, long qryId) { - if (!done()) - onQueryDone0(nodeId, qryId); - } - - /** - * @param nodeId Node ID. - * @param queryIds Query tracker Ids. - */ - void addActiveQueries(@NotNull UUID nodeId, @NotNull GridLongList queryIds) { - if (!done()) - addActiveQueries0(nodeId, queryIds); - } - - /** - * @return {@code True} if all queries mapped on previous coordinator are done. - */ - boolean done() { - return done; - } - - /** */ - private synchronized void onQueryDone0(@NotNull UUID nodeId, long qryId) { - assert qryId > 0; - - Node node = active.get(nodeId); - - if (node == null && !init) - active.put(nodeId, node = new Node()); - - if (node != null) { - Set<Long> cntrs = node.cntrs; - - boolean wasNull = cntrs == null; - - if (cntrs == null) - cntrs = node.cntrs = new HashSet<>(); - - if (wasNull || !cntrs.remove(qryId)) - cntrs.add(-qryId); - - if (init && node.isDone()) - removeAndCheckDone(nodeId); - } - } - - /** */ - private synchronized void addActiveQueries0(@NotNull UUID nodeId, @NotNull GridLongList queryIds) { - Node node = active.get(nodeId); - - if (node == null && !init) - active.put(nodeId, node = new Node()); - - if (node != null) { - Set<Long> cntrs = node.cntrs; - - boolean wasNull = cntrs == null, hasQueries = false; - - for (int i = 0; i < queryIds.size(); i++) { - long qryId = queryIds.get(i); - - assert qryId > 0; - - if (cntrs == null) - cntrs = node.cntrs = new HashSet<>(); - - if (wasNull || !cntrs.remove(-qryId)) - hasQueries |= cntrs.add(qryId); - } - - if (init && !hasQueries) - removeAndCheckDone(nodeId); - else - node.init = true; - } - } - - /** */ - private void removeAndCheckDone(@NotNull UUID nodeId) { - assert init; - - active.remove(nodeId); - - if (active.isEmpty()) - done = true; - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/StaticMvccQueryTracker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/StaticMvccQueryTracker.java deleted file mode 100644 index e191a165682..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/StaticMvccQueryTracker.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache.mvcc; - -import org.apache.ignite.internal.IgniteInternalFuture; -import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; -import org.apache.ignite.internal.processors.cache.GridCacheContext; -import org.apache.ignite.internal.util.future.GridFinishedFuture; - -/** - * Simple MVCC tracker used only as an Mvcc snapshot holder. - */ -public class StaticMvccQueryTracker implements MvccQueryTracker { - /** */ - private final MvccSnapshot snapshot; - - /** */ - private final GridCacheContext cctx; - - /** - * @param cctx Cache context. - * @param snapshot Mvcc snapshot. - */ - public StaticMvccQueryTracker(GridCacheContext cctx, MvccSnapshot snapshot) { - this.snapshot = snapshot; - this.cctx = cctx; - } - - /** {@inheritDoc} */ - @Override public MvccSnapshot snapshot() { - assert snapshot != null : this; - - return snapshot; - } - - /** {@inheritDoc} */ - @Override public GridCacheContext context() { - return cctx; - } - - /** {@inheritDoc} */ - @Override public AffinityTopologyVersion topologyVersion() { - return AffinityTopologyVersion.NONE; - } - - /** {@inheritDoc} */ - @Override public IgniteInternalFuture<MvccSnapshot> requestSnapshot() { - return new GridFinishedFuture<>(snapshot); - } - - /** {@inheritDoc} */ - @Override public void onDone() { - // No-op. - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/VacuumMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/VacuumMetrics.java deleted file mode 100644 index 1c1efb8ef4d..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/VacuumMetrics.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache.mvcc; - -/** - * - */ -public class VacuumMetrics { - /** */ - private long cleanupRowsCnt; - - /** */ - private long scannedRowsCnt; - - /** */ - private long searchNanoTime; - - /** */ - private long cleanupNanoTime; - - /** - * @return Cleanup rows count. - */ - public long cleanupRowsCount() { - return cleanupRowsCnt; - } - - /** - * @return Scanned rows count. - */ - public long scannedRowsCount() { - return scannedRowsCnt; - } - - /** - * @return Search nano time. - */ - public long searchNanoTime() { - return searchNanoTime; - } - - /** - * @return Cleanup nano time - */ - public long cleanupNanoTime() { - return cleanupNanoTime; - } - - /** - * @param delta Delta. - */ - public void addCleanupRowsCnt(long delta) { - cleanupRowsCnt += delta; - } - - /** - * @param delta Delta. - */ - public void addScannedRowsCount(long delta) { - scannedRowsCnt += delta; - } - - /** - * @param delta Delta. - */ - public void addSearchNanoTime(long delta) { - searchNanoTime += delta; - } - - /** - * @param delta Delta. - */ - public void addCleanupNanoTime(long delta) { - cleanupNanoTime += delta; - } - - /** */ - @Override public String toString() { - return "VacuumMetrics[" + - "cleanupRowsCnt=" + cleanupRowsCnt + - ", scannedRowsCnt=" + scannedRowsCnt + - ", searchNanoTime=" + Math.round((float)searchNanoTime / 1_000_000) + - " ms, cleanupNanoTime=" + Math.round((float)cleanupNanoTime / 1_000_000) + - " ms]"; - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/VacuumMetricsReducer.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/VacuumMetricsReducer.java deleted file mode 100644 index 15e6e4bc2f4..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/VacuumMetricsReducer.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache.mvcc; - -import org.apache.ignite.lang.IgniteReducer; -import org.jetbrains.annotations.Nullable; - -/** - * Vacuum metrics reducer. - */ -public class VacuumMetricsReducer implements IgniteReducer<VacuumMetrics, VacuumMetrics> { - /** */ - private static final long serialVersionUID = 7063457745963917386L; - - /** */ - private final VacuumMetrics m = new VacuumMetrics(); - - /** {@inheritDoc} */ - @Override public boolean collect(@Nullable VacuumMetrics metrics) { - assert metrics != null; - - m.addCleanupRowsCnt(metrics.cleanupRowsCount()); - m.addScannedRowsCount(metrics.scannedRowsCount()); - m.addSearchNanoTime(metrics.searchNanoTime()); - m.addCleanupNanoTime(metrics.cleanupNanoTime()); - - return true; - } - - /** {@inheritDoc} */ - @Override public VacuumMetrics reduce() { - return m; - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/VacuumTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/VacuumTask.java deleted file mode 100644 index cef35d4159e..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/VacuumTask.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache.mvcc; - -import org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtLocalPartition; -import org.apache.ignite.internal.util.future.GridFutureAdapter; -import org.apache.ignite.internal.util.tostring.GridToStringExclude; -import org.apache.ignite.internal.util.typedef.internal.S; - -/** - * Task for cleaning sing partition. - */ -public class VacuumTask extends GridFutureAdapter<VacuumMetrics> { - /** */ - private final MvccSnapshot snapshot; - - /** */ - @GridToStringExclude - private final GridDhtLocalPartition part; - - /** - * @param snapshot Snapshot. - * @param part Partition to cleanup. - */ - VacuumTask(MvccSnapshot snapshot, GridDhtLocalPartition part) { - this.snapshot = snapshot; - this.part = part; - } - - /** - * @return Snapshot. - */ - public MvccSnapshot snapshot() { - return snapshot; - } - - /** - * @return Partition to cleanup. - */ - public GridDhtLocalPartition part() { - return part; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(VacuumTask.class, this, "partId", part.id()); - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java index 1915448feaa..3597b5731d6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java @@ -22,7 +22,6 @@ import java.util.Collection; import java.util.Collections; import java.util.Deque; import java.util.HashSet; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -31,7 +30,6 @@ import java.util.Queue; import java.util.Set; import javax.cache.CacheException; import org.apache.ignite.IgniteCheckedException; -import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.query.Query; @@ -48,7 +46,6 @@ import org.apache.ignite.internal.processors.cache.GridCacheContext; import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheAdapter; import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtUnreservedPartitionException; import org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionTopology; -import org.apache.ignite.internal.processors.cache.mvcc.MvccQueryTracker; import org.apache.ignite.internal.processors.cache.mvcc.MvccSnapshot; import org.apache.ignite.internal.processors.query.QueryUtils; import org.apache.ignite.internal.util.GridCloseableIteratorAdapter; @@ -66,7 +63,6 @@ import org.apache.ignite.lang.IgniteBiPredicate; import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.lang.IgniteReducer; import org.apache.ignite.plugin.security.SecurityPermission; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import static org.apache.ignite.internal.processors.cache.query.GridCacheQueryType.INDEX; @@ -624,8 +620,6 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> { final GridCacheQueryManager qryMgr = cctx.queries(); - MvccQueryTracker mvccTracker = null; - boolean loc = nodes.size() == 1 && F.first(nodes).id().equals(cctx.localNodeId()); GridCloseableIterator it; @@ -637,7 +631,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> { else it = qryMgr.scanQueryDistributed(this, nodes); - return mvccTracker != null ? new MvccTrackingIterator(it, mvccTracker) : it; + return it; } /** @@ -974,94 +968,4 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> { t.get2().cancel(); } } - - /** - * Wrapper for an MVCC-related iterators. - */ - private static class MvccTrackingIterator implements GridCloseableIterator { - /** Serial version uid. */ - private static final long serialVersionUID = -1905248502802333832L; - - /** Underlying iterator. */ - private final GridCloseableIterator it; - - /** Query MVCC tracker. */ - private final MvccQueryTracker mvccTracker; - - /** - * Constructor. - * - * @param it Underlying iterator. - * @param mvccTracker Query MVCC tracker. - */ - MvccTrackingIterator(GridCloseableIterator it, MvccQueryTracker mvccTracker) { - assert it != null && mvccTracker != null; - - this.it = it; - this.mvccTracker = mvccTracker; - } - - /** {@inheritDoc} */ - @Override public void close() throws IgniteCheckedException { - if (isClosed()) - return; - - try { - it.close(); - } - finally { - mvccTracker.onDone(); - } - } - - /** {@inheritDoc} */ - @Override public boolean isClosed() { - return it.isClosed(); - } - - /** {@inheritDoc} */ - @Override public boolean hasNext() { - boolean hasNext = it.hasNext(); - - if (!hasNext) - try { - close(); - } - catch (IgniteCheckedException e) { - throw new IgniteException(e); - } - - return hasNext; - } - - /** {@inheritDoc} */ - @Override public boolean hasNextX() throws IgniteCheckedException { - boolean hasNext = it.hasNext(); - - if (!hasNext) - close(); - - return hasNext; - } - - /** {@inheritDoc} */ - @Override public Object nextX() throws IgniteCheckedException { - return it.nextX(); - } - - /** {@inheritDoc} */ - @Override public void removeX() throws IgniteCheckedException { - it.removeX(); - } - - /** {@inheritDoc} */ - @NotNull @Override public Iterator iterator() { - return this; - } - - /** {@inheritDoc} */ - @Override public Object next() { - return it.next(); - } - } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java index 3088d68c8d5..11c60fa873e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java @@ -756,10 +756,6 @@ public class PlatformConfigurationUtils { cfg.setActiveOnStart(in.readBoolean()); if (in.readBoolean()) cfg.setAuthenticationEnabled(in.readBoolean()); - if (in.readBoolean()) - cfg.setMvccVacuumFrequency(in.readLong()); - if (in.readBoolean()) - cfg.setMvccVacuumThreadCount(in.readInt()); if (in.readBoolean()) cfg.setSystemWorkerBlockedTimeout(in.readLong()); if (in.readBoolean()) @@ -1359,10 +1355,6 @@ public class PlatformConfigurationUtils { w.writeBoolean(cfg.isActiveOnStart()); w.writeBoolean(true); w.writeBoolean(cfg.isAuthenticationEnabled()); - w.writeBoolean(true); - w.writeLong(cfg.getMvccVacuumFrequency()); - w.writeBoolean(true); - w.writeInt(cfg.getMvccVacuumThreadCount()); if (cfg.getSystemWorkerBlockedTimeout() != null) { w.writeBoolean(true); w.writeLong(cfg.getSystemWorkerBlockedTimeout()); diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties index df34244fe99..02083690995 100644 --- a/modules/core/src/main/resources/META-INF/classnames.properties +++ b/modules/core/src/main/resources/META-INF/classnames.properties @@ -1127,7 +1127,6 @@ org.apache.ignite.internal.processors.cache.mvcc.MvccSnapshot org.apache.ignite.internal.processors.cache.mvcc.MvccSnapshotWithoutTxs org.apache.ignite.internal.processors.cache.mvcc.MvccVersionImpl org.apache.ignite.internal.processors.cache.mvcc.ProbedTx -org.apache.ignite.internal.processors.cache.mvcc.VacuumMetricsReducer org.apache.ignite.internal.processors.cache.persistence.CacheDataRowAdapter$RowData org.apache.ignite.internal.processors.cache.persistence.CheckpointState org.apache.ignite.internal.processors.cache.persistence.CorruptedDataStructureException diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2FieldsIterator.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2FieldsIterator.java index 98deab26f3e..0174fa487fa 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2FieldsIterator.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2FieldsIterator.java @@ -23,7 +23,6 @@ import java.util.Collections; import java.util.List; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteLogger; -import org.apache.ignite.internal.processors.cache.mvcc.MvccQueryTracker; import org.apache.ignite.internal.processors.tracing.Tracing; /** @@ -33,15 +32,11 @@ public class H2FieldsIterator extends H2ResultSetIterator<List<?>> { /** */ private static final long serialVersionUID = 0L; - /** */ - private transient MvccQueryTracker mvccTracker; - /** Connection. */ private final H2PooledConnection conn; /** * @param data Data. - * @param mvccTracker Mvcc tracker. * @param pageSize Page size. * @param conn Connection. * @param tracing Tracing processor. @@ -49,7 +44,6 @@ public class H2FieldsIterator extends H2ResultSetIterator<List<?>> { */ public H2FieldsIterator( ResultSet data, - MvccQueryTracker mvccTracker, H2PooledConnection conn, int pageSize, IgniteLogger log, @@ -62,7 +56,6 @@ public class H2FieldsIterator extends H2ResultSetIterator<List<?>> { assert conn != null; - this.mvccTracker = mvccTracker; this.conn = conn; } @@ -82,9 +75,6 @@ public class H2FieldsIterator extends H2ResultSetIterator<List<?>> { } finally { conn.close(); - - if (mvccTracker != null) - mvccTracker.onDone(); } } } diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java index 2356550a4d8..47c4f59f672 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java @@ -460,7 +460,6 @@ public class IgniteH2Indexing implements GridQueryIndexing { return new H2FieldsIterator( rs, - null, conn, qryParams.pageSize(), log, @@ -1424,7 +1423,6 @@ public class IgniteH2Indexing implements GridQueryIndexing { qryParams.arguments(), parts, qryParams.lazy(), - null, qryParams.dataPageScanEnabled(), qryParams.pageSize() ); diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java index b51084051b4..79f4a30a121 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java @@ -54,7 +54,6 @@ import org.apache.ignite.internal.cache.query.index.sorted.inline.InlineIndexImp import org.apache.ignite.internal.managers.communication.GridIoPolicy; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cache.GridCacheContext; -import org.apache.ignite.internal.processors.cache.mvcc.MvccQueryTracker; import org.apache.ignite.internal.processors.cache.query.GridCacheQueryType; import org.apache.ignite.internal.processors.cache.query.GridCacheSqlQuery; import org.apache.ignite.internal.processors.query.GridQueryCacheObjectsIterator; @@ -334,7 +333,6 @@ public class GridReduceQueryExecutor { * @param params Query parameters. * @param parts Partitions. * @param lazy Lazy execution flag. - * @param mvccTracker Query tracker. * @param dataPageScanEnabled If data page scan is enabled. * @param pageSize Page size. * @return Rows iterator. @@ -351,7 +349,6 @@ public class GridReduceQueryExecutor { Object[] params, int[] parts, boolean lazy, - MvccQueryTracker mvccTracker, Boolean dataPageScanEnabled, int pageSize ) { @@ -440,9 +437,6 @@ public class GridReduceQueryExecutor { .explicitTimeout(true) .schemaName(schemaName); - if (mvccTracker != null) - req.mvccSnapshot(mvccTracker.snapshot()); - final C2<ClusterNode, Message, Message> spec = parts == null ? null : new ReducePartitionsSpecializer(mapping.queryPartitionsMap()); @@ -488,7 +482,6 @@ public class GridReduceQueryExecutor { r, qryReqId, qry.distributedJoins(), - mvccTracker, ctx.tracing()); release = false; @@ -541,7 +534,6 @@ public class GridReduceQueryExecutor { resIter = new H2FieldsIterator( res, - mvccTracker, conn, r.pageSize(), log, @@ -551,8 +543,6 @@ public class GridReduceQueryExecutor { ); conn = null; - - mvccTracker = null; // To prevent callback inside finally block; } return new GridQueryCacheObjectsIterator(resIter, h2.objectContext(), keepBinary); @@ -582,7 +572,7 @@ public class GridReduceQueryExecutor { } finally { if (release) { - releaseRemoteResources(nodes, r, qryReqId, qry.distributedJoins(), mvccTracker); + releaseRemoteResources(nodes, r, qryReqId, qry.distributedJoins()); if (!skipMergeTbl) { for (int i = 0, mapQrys = mapQueries.size(); i < mapQrys; i++) @@ -1026,10 +1016,9 @@ public class GridReduceQueryExecutor { * @param r Query run. * @param qryReqId Query id. * @param distributedJoins Distributed join flag. - * @param mvccTracker MVCC tracker. */ void releaseRemoteResources(Collection<ClusterNode> nodes, ReduceQueryRun r, long qryReqId, - boolean distributedJoins, MvccQueryTracker mvccTracker) { + boolean distributedJoins) { try { if (distributedJoins) send(nodes, new GridQueryCancelRequest(qryReqId), null, true); @@ -1049,8 +1038,6 @@ public class GridReduceQueryExecutor { finally { if (!runs.remove(qryReqId, r)) U.warn(log, "Query run was already removed: " + qryReqId); - else if (mvccTracker != null) - mvccTracker.onDone(); } } diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/ReduceIndexIterator.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/ReduceIndexIterator.java index 20a9944ee49..dc39ac73c79 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/ReduceIndexIterator.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/ReduceIndexIterator.java @@ -23,13 +23,11 @@ import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; import org.apache.ignite.cluster.ClusterNode; -import org.apache.ignite.internal.processors.cache.mvcc.MvccQueryTracker; import org.apache.ignite.internal.processors.tracing.MTC; import org.apache.ignite.internal.processors.tracing.MTC.TraceSurroundings; import org.apache.ignite.internal.processors.tracing.Tracing; import org.h2.index.Cursor; import org.h2.result.Row; -import org.jetbrains.annotations.Nullable; import static org.apache.ignite.internal.processors.tracing.SpanType.SQL_ITER_CLOSE; @@ -64,9 +62,6 @@ public class ReduceIndexIterator implements Iterator<List<?>>, AutoCloseable { /** Whether remote resources were released. */ private boolean released; - /** */ - private MvccQueryTracker mvccTracker; - /** Tracing processor. */ private final Tracing tracing; @@ -85,7 +80,6 @@ public class ReduceIndexIterator implements Iterator<List<?>>, AutoCloseable { ReduceQueryRun run, long qryReqId, boolean distributedJoins, - @Nullable MvccQueryTracker mvccTracker, Tracing tracing ) { this.rdcExec = rdcExec; @@ -93,7 +87,6 @@ public class ReduceIndexIterator implements Iterator<List<?>>, AutoCloseable { this.run = run; this.qryReqId = qryReqId; this.distributedJoins = distributedJoins; - this.mvccTracker = mvccTracker; this.tracing = tracing; rdcIter = run.reducers().iterator(); @@ -175,7 +168,7 @@ public class ReduceIndexIterator implements Iterator<List<?>>, AutoCloseable { private void releaseIfNeeded() { if (!released) { try { - rdcExec.releaseRemoteResources(nodes, run, qryReqId, distributedJoins, mvccTracker); + rdcExec.releaseRemoteResources(nodes, run, qryReqId, distributedJoins); } finally { released = true; diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml index 11c129daa4a..ba7332f64fa 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml @@ -23,7 +23,7 @@ workDirectory='c:' JvmMaxMemoryMb='1024' MetricsLogFrequency='0:0:10' isLateAffinityAssignment='false' springConfigUrl='c:\myconfig.xml' autoGenerateIgniteInstanceName='true' peerAssemblyLoadingMode='CurrentAppDomain' longQueryWarningTimeout='1:2:3' isActiveOnStart='false' - consistentId='someId012' redirectJavaConsoleOutput='false' authenticationEnabled='true' mvccVacuumFrequency='10000' mvccVacuumThreadCount='4' + consistentId='someId012' redirectJavaConsoleOutput='false' authenticationEnabled='true' sqlQueryHistorySize='123' javaPeerClassLoadingEnabled='true' asyncContinuationExecutor='UnsafeSynchronous'> <localhost>127.1.1.1</localhost> <binaryConfiguration compactFooter='false' keepDeserialized='true'> diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs index 4f6b3b4a17b..6085e218348 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs @@ -100,8 +100,6 @@ namespace Apache.Ignite.Core.Tests Assert.IsFalse(cfg.IsActiveOnStart); Assert.IsTrue(cfg.AuthenticationEnabled); - Assert.AreEqual(10000, cfg.MvccVacuumFrequency); - Assert.AreEqual(4, cfg.MvccVacuumThreadCount); Assert.AreEqual(123, cfg.SqlQueryHistorySize); Assert.AreEqual(true, cfg.JavaPeerClassLoadingEnabled); diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs index 642ee1dc13d..2007aa36fcb 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs @@ -262,8 +262,6 @@ namespace Apache.Ignite.Core.Tests AssertExtensions.ReflectionEqual(cfg.DataStorageConfiguration, resCfg.DataStorageConfiguration); - Assert.AreEqual(cfg.MvccVacuumFrequency, resCfg.MvccVacuumFrequency); - Assert.AreEqual(cfg.MvccVacuumThreadCount, resCfg.MvccVacuumThreadCount); Assert.AreEqual(cfg.SqlQueryHistorySize, resCfg.SqlQueryHistorySize); Assert.IsNotNull(resCfg.SqlSchemas); @@ -553,8 +551,6 @@ namespace Apache.Ignite.Core.Tests cfg.ClientConnectorConfigurationEnabled); Assert.AreEqual(IgniteConfiguration.DefaultRedirectJavaConsoleOutput, cfg.RedirectJavaConsoleOutput); Assert.AreEqual(IgniteConfiguration.DefaultAuthenticationEnabled, cfg.AuthenticationEnabled); - Assert.AreEqual(IgniteConfiguration.DefaultMvccVacuumFrequency, cfg.MvccVacuumFrequency); - Assert.AreEqual(IgniteConfiguration.DefaultMvccVacuumThreadCount, cfg.MvccVacuumThreadCount); Assert.AreEqual(AsyncContinuationExecutor.ThreadPool, cfg.AsyncContinuationExecutor); // Thread pools. @@ -935,8 +931,6 @@ namespace Apache.Ignite.Core.Tests } }, AuthenticationEnabled = false, - MvccVacuumFrequency = 20000, - MvccVacuumThreadCount = 8, SqlQueryHistorySize = 99, JavaPeerClassLoadingEnabled = false, SqlSchemas = new List<string> { "SCHEMA_3", "schema_4" }, diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs index 7e95ee85cda..cd252fa1c33 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs @@ -206,12 +206,6 @@ namespace Apache.Ignite.Core /** Map from user-defined listener to it's id. */ private Dictionary<object, int> _localEventListenerIds; - /** MVCC vacuum frequency. */ - private long? _mvccVacuumFreq; - - /** MVCC vacuum thread count. */ - private int? _mvccVacuumThreadCnt; - /** SQL query history size. */ private int? _sqlQueryHistorySize; @@ -246,16 +240,6 @@ namespace Apache.Ignite.Core /// </summary> public const bool DefaultAuthenticationEnabled = false; - /// <summary> - /// Default value for <see cref="MvccVacuumFrequency"/> property. - /// </summary> - public const long DefaultMvccVacuumFrequency = 5000; - - /// <summary> - /// Default value for <see cref="MvccVacuumThreadCount"/> property. - /// </summary> - public const int DefaultMvccVacuumThreadCount = 2; - /// <summary> /// Default value for <see cref="SqlQueryHistorySize"/> property. /// </summary> @@ -336,8 +320,6 @@ namespace Apache.Ignite.Core writer.WriteTimeSpanAsLongNullable(_longQueryWarningTimeout); writer.WriteBooleanNullable(_isActiveOnStart); writer.WriteBooleanNullable(_authenticationEnabled); - writer.WriteLongNullable(_mvccVacuumFreq); - writer.WriteIntNullable(_mvccVacuumThreadCnt); writer.WriteTimeSpanAsLongNullable(_sysWorkerBlockedTimeout); writer.WriteIntNullable(_sqlQueryHistorySize); writer.WriteBooleanNullable(_javaPeerClassLoadingEnabled); @@ -740,8 +722,6 @@ namespace Apache.Ignite.Core _longQueryWarningTimeout = r.ReadTimeSpanNullable(); _isActiveOnStart = r.ReadBooleanNullable(); _authenticationEnabled = r.ReadBooleanNullable(); - _mvccVacuumFreq = r.ReadLongNullable(); - _mvccVacuumThreadCnt = r.ReadIntNullable(); _sysWorkerBlockedTimeout = r.ReadTimeSpanNullable(); _sqlQueryHistorySize = r.ReadIntNullable(); _javaPeerClassLoadingEnabled = r.ReadBooleanNullable(); @@ -1637,32 +1617,6 @@ namespace Apache.Ignite.Core set { _authenticationEnabled = value; } } - /// <summary> - /// This is an experimental feature. Transactional SQL is currently in a beta status. - /// <para/> - /// Time interval between MVCC vacuum runs in milliseconds. - /// </summary> - [DefaultValue(DefaultMvccVacuumFrequency)] - [IgniteExperimental] - public long MvccVacuumFrequency - { - get { return _mvccVacuumFreq ?? DefaultMvccVacuumFrequency; } - set { _mvccVacuumFreq = value; } - } - - /// <summary> - /// This is an experimental feature. Transactional SQL is currently in a beta status. - /// <para/> - /// Number of MVCC vacuum threads. - /// </summary> - [DefaultValue(DefaultMvccVacuumThreadCount)] - [IgniteExperimental] - public int MvccVacuumThreadCount - { - get { return _mvccVacuumThreadCnt ?? DefaultMvccVacuumThreadCount; } - set { _mvccVacuumThreadCnt = value; } - } - /// <summary> /// Gets or sets the value indicating the number of SQL query history elements to keep in memory. /// Zero or negative value disables the history. diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd index 7ca5b11c7a2..bde2ad9eded 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd +++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd @@ -2501,16 +2501,6 @@ <xs:documentation>Whether user authentication is enabled for the cluster.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="mvccVacuumFrequency" type="xs:long"> - <xs:annotation> - <xs:documentation>Time interval between MVCC vacuum runs in milliseconds.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="mvccVacuumThreadCount" type="xs:int"> - <xs:annotation> - <xs:documentation>Number of MVCC vacuum threads.</xs:documentation> - </xs:annotation> - </xs:attribute> <xs:attribute name="sqlQueryHistorySize" type="xs:int"> <xs:annotation> <xs:documentation>Number of SQL query history elements to keep in memory.</xs:documentation>