-
Notifications
You must be signed in to change notification settings - Fork 111
Online Indexer: replace the synchronized runner with a heartbeat #3530
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
Open
jjezra
wants to merge
23
commits into
FoundationDB:main
Choose a base branch
from
jjezra:indexing_heartbeat
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,531
−305
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
55c270a
Online Indexer: replace the synchronized runner with a heartbeat
jjezra ca01fe8
Set/clear heartbeats at start/end
jjezra 17f1aa7
Optimize heartbeat clear. Deprecate use-sync-indexing API
jjezra a5891b0
false AvoidUsingHardCodedIP warning
jjezra 7e0fa30
Clear heartbeats after rebuild (whting the same transaction)
jjezra afa990d
Itarate targets explicitly after rebuild
jjezra a9b5917
thenApply -> whenComplete
jjezra 747d76f
Add API get/clear heartbeats
jjezra 826dfa4
Add 1st test - low level
jjezra 8759309
Add two more tests
jjezra 26d7f2c
Add a comment..
jjezra 988f107
Deprecated sync lock API functions
jjezra bbf3af6
Some cleanup
jjezra 587fdb2
At genesis, first check indexing type, then heartbeat
jjezra eff9c18
Use subspace(...).unpack(..)
jjezra b628851
Verify no leftover heartbeats after any singleRebuild
jjezra f9c08b2
Apply Scott's requested changes
jjezra e5cbef1
Apply (more of) Scott's requested changes
jjezra a8eff82
Apply (even more of) Scott's requested changes
jjezra 5e3d370
Minor cleanup to make IndexingBase a little shorter
jjezra 73442f0
pmdMain: unused param
jjezra fbfd5c5
Apply PR requested changes
jjezra 48f0f07
Attempt to please some Teamscale croaks - untested (deprecated) funct…
jjezra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
282 changes: 119 additions & 163 deletions
282
...-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/IndexingBase.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,6 @@ | |
import com.apple.foundationdb.record.metadata.Index; | ||
import com.apple.foundationdb.record.metadata.MetaDataException; | ||
import com.apple.foundationdb.record.provider.common.RecordSerializer; | ||
import com.apple.foundationdb.record.provider.foundationdb.synchronizedsession.SynchronizedSessionRunner; | ||
import com.apple.foundationdb.subspace.Subspace; | ||
import com.google.protobuf.Message; | ||
|
||
|
@@ -709,26 +708,32 @@ public B setTransactionTimeLimitMilliseconds(long timeLimitMilliseconds) { | |
} | ||
|
||
/** | ||
* <em>Deprecated</em>. This will soon be determined by the indexing session type | ||
* <em>Deprecated</em>. Synchronization is handled by shared heartbeats and exclusive access is being determined by | ||
* the indexing session type. | ||
* | ||
* <em> When upgrading from Synchronized sessions to a version that uses Shared Heartbeats</em>: | ||
* During graduate code upgrade on multiple servers, there may be a state of one server indexing | ||
* with a synchronized session lock, while another server builds the same index with an exclusive heartbeat | ||
* "lock". If that happens: | ||
* a) There will be no more than two concurrent active sessions (one per each lock type). | ||
* b) The indexing sessions will conflict each other until one of the indexers will give up. While this is | ||
* not optimal, the generated index will be valid. | ||
* | ||
* Set the use of a synchronized session during the index operation. Synchronized sessions help performing | ||
* the multiple transactions operations in a resource efficient way. | ||
* Normally this should be {@code true}. | ||
* | ||
* @see SynchronizedSessionRunner | ||
* @param useSynchronizedSession use synchronize session if true, otherwise false | ||
* @return this builder | ||
*/ | ||
@API(API.Status.DEPRECATED) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this class be marked |
||
public B setUseSynchronizedSession(boolean useSynchronizedSession) { | ||
configBuilder.setUseSynchronizedSession(useSynchronizedSession); | ||
return self(); | ||
} | ||
|
||
/** | ||
* Set the lease length in milliseconds if the synchronized session is used. The default value is {@link OnlineIndexOperationConfig#DEFAULT_LEASE_LENGTH_MILLIS}. | ||
* @see #setUseSynchronizedSession(boolean) | ||
* @see com.apple.foundationdb.synchronizedsession.SynchronizedSession | ||
* @param leaseLengthMillis length between last access and lease's end time in milliseconds | ||
* Set the max age of an indexing heartbeat to define an "active" indexing session. | ||
* @param leaseLengthMillis max heartbeat age to be considered "active". In milliseconds | ||
* @return this builder | ||
*/ | ||
public B setLeaseLengthMillis(long leaseLengthMillis) { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.