<p></p>
<p><b>@freimair</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/4233#discussion_r427813743">p2p/src/main/java/bisq/network/p2p/storage/persistence/SplitStoreService.java</a>:</p>
<pre style='color:#555'>> +        if (getMap().containsKey(hash))
+            return;
+
+        store.getMap().put(hash, payload);
+        persist();
+    }
+
+    @Override
+    protected PersistableNetworkPayload putIfAbsent(P2PDataStorage.ByteArray hash,
+                                                    PersistableNetworkPayload payload) {
+        // make sure we do not add data that we already have (in a bin of historical data)
+        if (getMap().containsKey(hash))
+            return null;
+
+        PersistableNetworkPayload previous = store.getMap().putIfAbsent(hash, payload);
+        persist();
</pre>
<p>agreed. However, it is not trivial to find whether there has been something added to the map or not since the nested <code>put(...)</code> only returns the old value.</p>
<p>I believe that is why MapStoreService does this exactly that way (and that might be one source of our IO issues.</p>
<p>I decided to stick with the "proven" way of doing things until we can address the whole disk IO issue in a more general way <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="595721729" data-permission-text="Title is private" data-url="https://github.com/bisq-network/projects/issues/29" data-hovercard-type="issue" data-hovercard-url="/bisq-network/projects/issues/29/hovercard" href="https://github.com/bisq-network/projects/issues/29">bisq-network/projects#29</a></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/4233#discussion_r427813743">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNVYBIF2ZWSG6D3DH4LRSOEXPANCNFSM4MY33J4A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNXKAR3C2TZGB65MOHDRSOEXPA5CNFSM4MY33J4KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGODC62RKY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/4233#discussion_r427813743",
"url": "https://github.com/bisq-network/bisq/pull/4233#discussion_r427813743",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>