You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by tk...@apache.org on 2025/03/26 06:55:55 UTC
(ignite-3) branch main updated: IGNITE-24919 Make non-blocking get a compaction revision for the MetaStorageManager (#5497)
This is an automated email from the ASF dual-hosted git repository.
tkalkirill pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 404bef9c2c6 IGNITE-24919 Make non-blocking get a compaction revision for the MetaStorageManager (#5497)
404bef9c2c6 is described below
commit 404bef9c2c6c96d05ce58783121ea51952d3062b
Author: Kirill Tkalenko <tk...@yandex.ru>
AuthorDate: Wed Mar 26 09:55:50 2025 +0300
IGNITE-24919 Make non-blocking get a compaction revision for the MetaStorageManager (#5497)
---
.../metastorage/server/AbstractKeyValueStorage.java | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/AbstractKeyValueStorage.java b/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/AbstractKeyValueStorage.java
index 23112ae3861..6714b89c25a 100644
--- a/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/AbstractKeyValueStorage.java
+++ b/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/AbstractKeyValueStorage.java
@@ -81,8 +81,11 @@ public abstract class AbstractKeyValueStorage implements KeyValueStorage {
* <p>This field is used by metastorage read methods to determine whether {@link CompactedException} should be thrown.</p>
*
* <p>Multi-threaded access is guarded by {@link #rwLock}.</p>
+ *
+ * <p>Field with a volatile so as not to be blocked when reading the compaction revision by other components, for example due to long
+ * write operations, including the compaction itself.</p>
*/
- protected long compactionRevision = -1;
+ protected volatile long compactionRevision = -1;
/**
* Planned for update compaction revision to ensure monotony without duplicates when updating it.
@@ -255,13 +258,7 @@ public abstract class AbstractKeyValueStorage implements KeyValueStorage {
@Override
public long getCompactionRevision() {
- rwLock.readLock().lock();
-
- try {
- return compactionRevision;
- } finally {
- rwLock.readLock().unlock();
- }
+ return compactionRevision;
}
@Override