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

A bug in nodestate transition logic? #6663

Closed
jerrinot opened this issue Nov 5, 2015 · 5 comments

Comments

Projects
None yet
5 participants
@jerrinot
Copy link
Contributor

commented Nov 5, 2015

this code has an ability to freeze my member in the latest master (a7788ba) :

public class MapTest {
    public static void main(String[] args) throws InterruptedException {
        HazelcastInstance i1 = Hazelcast.newHazelcastInstance();
        HazelcastInstance i2 = Hazelcast.newHazelcastInstance();

        final IMap<Integer, Integer> map = i1.getMap("map");

        int itemsCount = 1000000;
        for (int i = 0; i < itemsCount; i++) {
            map.put(i, i);
            if (i % 10000 == 0) {
                System.out.println("Loading progress: " + i + " / " + itemsCount);
            }
        }


        int stressThreadsCount = 5;
        for (int i = 0; i < stressThreadsCount; i++) {
            new StressThread(map).start();
        }

        for (;;) {
            i2.shutdown();
            i2 = Hazelcast.newHazelcastInstance();
        }
    }

    private static class StressThread extends Thread {
        private final IMap<Integer, Integer> map;

        public StressThread(IMap<Integer, Integer> map) {
            this.map = map;
        }

        @Override
        public void run() {
            for (;;) {
                map.containsKey(0);
            }
        }
    }
}

I can see this in the log:

WARNING: [10.8.0.10]:5702 [dev] [3.6-RC1-SNAPSHOT] Partition table received before startup is completed. Caller: Address[10.8.0.10]:5701
Nov 05, 2015 7:36:55 PM com.hazelcast.partition.InternalPartitionService
INFO: [10.8.0.10]:5702 [dev] [3.6-RC1-SNAPSHOT] Waiting for active migration tasks: 42
Nov 05, 2015 7:36:56 PM com.hazelcast.partition.InternalPartitionService
INFO: [10.8.0.10]:5702 [dev] [3.6-RC1-SNAPSHOT] Waiting for active migration tasks: 42
Nov 05, 2015 7:36:57 PM com.hazelcast.partition.InternalPartitionService
INFO: [10.8.0.10]:5702 [dev] [3.6-RC1-SNAPSHOT] Waiting for active migration tasks: 42
Nov 05, 2015 7:36:58 PM com.hazelcast.partition.InternalPartitionService
INFO: [10.8.0.10]:5702 [dev] [3.6-RC1-SNAPSHOT] Waiting for active migration tasks: 42
Nov 05, 2015 7:36:59 PM com.hazelcast.partition.InternalPartitionService
INFO: [10.8.0.10]:5702 [dev] [3.6-RC1-SNAPSHOT] Waiting for active migration tasks: 42
Nov 05, 2015 7:37:00 PM com.hazelcast.partition.InternalPartitionService
INFO: [10.8.0.10]:5702 [dev] [3.6-RC1-SNAPSHOT] Waiting for active migration tasks: 42
Nov 05, 2015 7:37:01 PM com.hazelcast.partition.InternalPartitionService
INFO: [10.8.0.10]:5702 [dev] [3.6-RC1-SNAPSHOT] Waiting for active migration tasks: 42
Nov 05, 2015 7:37:02 PM com.hazelcast.partition.InternalPartitionService
INFO: [10.8.0.10]:5702 [dev] [3.6-RC1-SNAPSHOT] Waiting for active migration tasks: 42
Nov 05, 2015 7:37:03 PM com.hazelcast.partition.InternalPartitionService
INFO: [10.8.0.10]:5702 [dev] [3.6-RC1-SNAPSHOT] Waiting for active migration tasks: 42
Nov 05, 2015 7:37:04 PM com.hazelcast.partition.InternalPartitionService
INFO: [10.8.0.10]:5702 [dev] [3.6-RC1-SNAPSHOT] Waiting for active migration tasks: 42
Nov 05, 2015 7:37:05 PM com.hazelcast.partition.InternalPartitionService
INFO: [10.8.0.10]:5702 [dev] [3.6-RC1-SNAPSHOT] Waiting for active migration tasks: 42
Nov 05, 2015 7:37:06 PM com.hazelcast.partition.InternalPartitionService

it's repeating over and over again, but it seems it never recovers.

@mdogan

This comment has been minimized.

Copy link
Member

commented Nov 5, 2015

@metanet: this looks like caused by our latest change. #6642

@metanet

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2015

Yes, I think so. I will investigate it in the morning. Most probably we accidentally blocked something that runs during shutdown.

@metanet metanet self-assigned this Nov 6, 2015

@metanet

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2015

I am working on this

@bwzhang2011

This comment has been minimized.

Copy link

commented Nov 7, 2015

@metanet, did such issue 3.6 branch related or other version related too ?

@metanet

This comment has been minimized.

Copy link
Contributor

commented Nov 7, 2015

Such issue only exists in master

metanet added a commit to metanet/hazelcast that referenced this issue Nov 8, 2015

Fix migration state problems on node shutdown and join
* Do not trigger RepartitioningTask if cluster state is not active. It causes infinite retries and prevents nodes to shutdown since they think that there is an ongoing migration
* Introduce NodeExtension.isStartCompleted() method and use it in PartitionStateOperation instead of checking NodeState. It is a no-op method for OSS and has an implementation on enterprise.

Fixes hazelcast#6663

metanet added a commit to metanet/hazelcast that referenced this issue Nov 8, 2015

* Do not trigger RepartitioningTask if cluster state is not active. I…
…t causes infinite retries and prevents nodes to shutdown since they think that there is an ongoing migration

* Introduce NodeExtension.isStartCompleted() method and use it in PartitionStateOperation instead of checking NodeState. It is a no-op method for OSS and has an implementation on enterprise.
* Fix assertion in FrozenPartitionTableTest

Fixes hazelcast#6663

metanet added a commit to metanet/hazelcast that referenced this issue Nov 9, 2015

* Do not trigger RepartitioningTask if cluster state is not active. I…
…t causes infinite retries and prevents nodes to shutdown since they think that there is an ongoing migration

* Introduce NodeExtension.isStartCompleted() method and use it in PartitionStateOperation instead of checking NodeState. It is a no-op method for OSS and has an implementation on enterprise.
* Fix assertion in FrozenPartitionTableTest

Fixes hazelcast#6663

metanet added a commit to metanet/hazelcast that referenced this issue Nov 9, 2015

* Do not trigger RepartitioningTask if cluster state is not active. I…
…t causes infinite retries and prevents nodes to shutdown since they think that there is an ongoing migration

* Introduce NodeExtension.isStartCompleted() method and use it in PartitionStateOperation instead of checking NodeState. It is a no-op method for OSS and has an implementation on enterprise.
* Publish partition table on all cluster states
* Fix assertion in FrozenPartitionTableTest

Fixes hazelcast#6663

metanet added a commit to metanet/hazelcast that referenced this issue Nov 9, 2015

* Do not trigger RepartitioningTask if cluster state is not active. I…
…t causes infinite retries and prevents nodes to shutdown since they think that there is an ongoing migration

* Introduce NodeExtension.isStartCompleted() method and use it in PartitionStateOperation instead of checking NodeState. It is a no-op method for OSS and has an implementation on enterprise.
* Publish partition table on all cluster states
* Fix assertion in FrozenPartitionTableTest

Fixes hazelcast#6663

@mdogan mdogan closed this in #6685 Nov 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.