ibessonov commented on code in PR #1405:
URL: https://github.com/apache/ignite-3/pull/1405#discussion_r1048263068


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/PersistentPageMemoryMvPartitionStorage.java:
##########
@@ -226,22 +262,37 @@ public void 
committedGroupConfiguration(RaftGroupConfiguration config) {
         assert checkpointTimeoutLock.checkpointLockIsHeldByThread();
 
         CheckpointProgress lastCheckpoint = 
checkpointManager.lastCheckpointProgress();
-
         UUID lastCheckpointId = lastCheckpoint == null ? null : 
lastCheckpoint.id();
 
-        meta.lastGroupConfig(lastCheckpointId, groupConfigToBytes(config));
+        byte[] raftGroupConfigBytes = raftGroupConfigToBytes(config);
+
+        raftGroupConfigReadWriteLock.writeLock().lock();
+
+        try {
+            if (meta.lastRaftGroupConfigFirstPageId() == 
BlobStorage.NO_PAGE_ID) {
+                long configPageId = blobStorage.addBlob(raftGroupConfigBytes);
+
+                meta.lastRaftGroupConfigFirstPageId(lastCheckpointId, 
configPageId);
+            } else {
+                blobStorage.updateBlob(meta.lastRaftGroupConfigFirstPageId(), 
raftGroupConfigBytes);
+            }
+        } catch (IgniteInternalCheckedException e) {
+            throw new StorageException("Cannot save committed group 
configuration, groupId=" + groupId + ", partitionId=" + groupId, e);
+        } finally {
+            raftGroupConfigReadWriteLock.writeLock().unlock();
+        }
     }
 
     @Nullable
-    private static RaftGroupConfiguration groupConfigFromBytes(byte @Nullable 
[] bytes) {
+    private static RaftGroupConfiguration raftGroupConfigFromBytes(byte 
@Nullable [] bytes) {

Review Comment:
   Thank you!



-- 
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]

Reply via email to