timoninmaxim commented on code in PR #12515:
URL: https://github.com/apache/ignite/pull/12515#discussion_r2605987578
##########
modules/core/src/main/java/org/apache/ignite/IgniteCluster.java:
##########
@@ -544,6 +544,31 @@ public IgniteFuture<Collection<ClusterStartNodeResult>>
startNodesAsync(Collecti
*/
public boolean disableWal(String cacheName) throws IgniteException;
+ /**
+ * Disables write-ahead logging for specified caches. When WAL is
disabled, changes are not logged to disk.
+ * This significantly improves cache update speed. The drawback is absence
of local crash-recovery guarantees.
+ * If node is crashed, local content of WAL-disabled cache will be cleared
on restart to avoid data corruption.
+ * <p>
+ * Internally this method will wait for all current cache operations to
finish and prevent new cache operations
+ * from being executed. Then checkpoint is initiated to flush all data to
disk. Control is returned to the callee
+ * when all dirty pages are prepared for checkpoint, but not necessarily
flushed to disk.
+ * <p>
+ * WAL state can be changed only for persistent caches.
+ * <p>
+ * <b>NOTE:</b>
+ * Currently, this method should only be called on a stable topology when
no nodes are leaving or joining cluster,
+ * and all baseline nodes are present.
+ * Cache may be stuck in inconsistent state due to violation of these
conditions. It is advised to destroy
+ * such cache.
+ *
+ * @param cacheNames Collection of cache names.
+ * @return Whether WAL state of at least one cache was actually changed by
the call.
+ * @throws IgniteException If error occurs.
+ * @see #enableWal(Collection)
+ * @see #isWalEnabled(String)
+ */
+ public boolean disableWal(Collection<String> cacheNames) throws
IgniteException;
Review Comment:
Let's add restriction - all caches must be in the same cache group
##########
modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java:
##########
@@ -648,12 +658,26 @@ private void setBaselineTopology(long topVer, boolean
isBaselineAutoAdjust) {
* @return {@code True} if WAL mode was changed as a result of this call.
*/
private boolean changeWalMode(String cacheName, boolean enabled) {
- A.notNull(cacheName, "cacheName");
+ return changeWalMode(Collections.singleton(cacheName), enabled);
Review Comment:
No need in this intermediate method
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]