Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- patch -p1 < 582.patch
- patching file src/java/org/apache/cassandra/service/StorageService.java
- Hunk #1 FAILED at 968.
- Hunk #2 FAILED at 1013.
- 2 out of 2 hunks FAILED -- saving rejects to file src/java/org/apache/cassandra/service/StorageService.java.rej
- cat src/java/org/apache/cassandra/service/StorageService.java.rej
- ***************
- *** 968,978 ****
- unbootstrap(finishLeaving);
- }
- private void unbootstrap(final Runnable onFinish)
- {
- Multimap<Range, InetAddress> rangesMM = getChangedRangesForLeaving(FBUtilities.getLocalAddress());
- if (logger_.isDebugEnabled())
- logger_.debug("Ranges needing transfer are [" + StringUtils.join(rangesMM.keySet(), ",") + "]");
- final Set<Map.Entry<Range, InetAddress>> pending = new HashSet<Map.Entry<Range, InetAddress>>(rangesMM.entries());
- for (final Map.Entry<Range, InetAddress> entry : rangesMM.entries())
- {
- --- 968,1006 ----
- unbootstrap(finishLeaving);
- }
- + private void leaveRing()
- + {
- + SystemTable.setBootstrapped(false);
- + tokenMetadata_.removeEndpoint(FBUtilities.getLocalAddress());
- + replicationStrategy_.removeObsoletePendingRanges();
- +
- + if (logger_.isDebugEnabled())
- + logger_.debug("");
- + Gossiper.instance().addApplicationState(STATE_LEFT, new ApplicationState(getLocalToken().toString()));
- + try
- + {
- + Thread.sleep(2 * Gossiper.intervalInMillis_);
- + }
- + catch (InterruptedException e)
- + {
- + throw new AssertionError(e);
- + }
- + }
- +
- private void unbootstrap(final Runnable onFinish)
- {
- Multimap<Range, InetAddress> rangesMM = getChangedRangesForLeaving(FBUtilities.getLocalAddress());
- if (logger_.isDebugEnabled())
- logger_.debug("Ranges needing transfer are [" + StringUtils.join(rangesMM.keySet(), ",") + "]");
- +
- + if (rangesMM.isEmpty())
- + {
- + // nothing needs transfer, so leave immediately. this can happen when replication factor == number of nodes.
- + leaveRing();
- + onFinish.run();
- + return;
- + }
- +
- final Set<Map.Entry<Range, InetAddress>> pending = new HashSet<Map.Entry<Range, InetAddress>>(rangesMM.entries());
- for (final Map.Entry<Range, InetAddress> entry : rangesMM.entries())
- {
- ***************
- *** 985,1006 ****
- pending.remove(entry);
- if (pending.isEmpty())
- {
- - SystemTable.setBootstrapped(false);
- - tokenMetadata_.removeEndpoint(FBUtilities.getLocalAddress());
- - replicationStrategy_.removeObsoletePendingRanges();
- -
- - if (logger_.isDebugEnabled())
- - logger_.debug("");
- - Gossiper.instance().addApplicationState(STATE_LEFT, new ApplicationState(getLocalToken().toString()));
- - try
- - {
- - Thread.sleep(2 * Gossiper.intervalInMillis_);
- - }
- - catch (InterruptedException e)
- - {
- - throw new AssertionError(e);
- - }
- -
- onFinish.run();
- }
- }
- --- 1013,1019 ----
- pending.remove(entry);
- if (pending.isEmpty())
- {
- + leaveRing();
- onFinish.run();
- }
- }
Add Comment
Please, Sign In to add comment