Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-6324 Transactional cache data partially available after crash. #2961

Closed
wants to merge 4 commits into from

Conversation

dgovorukhin
Copy link
Contributor

No description provided.

* @param topVer Topology version.
* @return List of consistent ids.
*/
public List<Object> mapToConsistentId(AffinityTopologyVersion topVer) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not calculate this list on-demand. Since the list is fixed on topologyVersion, this list should be moved to the DiscoCache

if (preLocked == null)
fileLockHolder = new FileLockHolder(storeMgr.workDir().getPath(), kernalCtx, log);

persStoreMetrics.wal(cctx.wal());

recoveryIo = new RecoveryIoImp(kernalCtx, log);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RecoveryIo looks redundant, we do not use such a pattern. Instead, we probably should add a recovery processor which will add this listener on startup and manager recovery future(s).

*
*/
private void restoreUpdates(final RecoveryContext recCtx) throws IgniteCheckedException {
final Map<T2<Integer, Integer>, T2<Integer, Long>> partStates = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Map of tuples may be too heap-consuming. Check if CachePartitionPartialCountersMap can be used or modified for this use-case.

/**
*
*/
public interface IgniteRecoveryFuture<R> extends IgniteInternalFuture<R> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having recovery future dependant on WAL iterator is abstraction leak. We should simply have an init() method on it, and it will construct the required iterator internally.

try {
f.get();

if (msg instanceof TxStateRequest) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split different message processing into different methods

}
});

recoveryIo.onNodeLeft(new CI1<String>() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually place onNodeLeft callbacks on futures, this is another indication that RecoveryIo should be removed

).toString();

handler.apply(constId, (Message)msg);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not silently drop a message. If a listener is supposed to be always installed before a first message is sent, we should at least print a warning.

@@ -315,7 +315,7 @@ public RecordDataV1Serializer(GridCacheSharedContext cctx) {
long msb = in.readLong();
long lsb = in.readLong();
boolean hasPtr = in.readByte() != 0;
int idx = hasPtr ? in.readInt() : 0;
long idx = hasPtr ? in.readLong() : 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not this break compatibility?

FileWALPointer pntCandidate = null;

for (IgniteInternalTx tx : txs)
if (tx instanceof IgniteTxAdapter) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use instanceof, just add a method to the IgniteInternalTx interface

WALPointer ptr = txAdapter.prepPtr;

if (ptr != null && ptr instanceof FileWALPointer) {
FileWALPointer ptr0 = (FileWALPointer)ptr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do not cast to FileWALPointer here, add Comparable to wal pointer interface.

@dgovorukhin dgovorukhin closed this Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants