-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Update to TinkerPop 3.2.3 #78
Conversation
Committer of one or more commits is not listed as a CLA signer, either individual or as a member of an organization. |
@dylanht – your commits list your name as "dylanht" rather than using your full name, so the CLA checker did not like that, so please fix that (I'd prefer to avoid special-casing multiple names for commits). That said, due to a requirement from The Linux Foundation, all commits need to include the Since you're going to add the DCO sign-off, please also update your name in the commits, and everything will be accepted by the CLA checker. @sjudeng — the DCO similarly applies to your commits as well, but your name / email are correct as-written and as-recorded in the CLA signers list, so you just to add the sign-off. Thanks for your help and sorry for the inconvenience. |
Not sure why @janusgraph-bot is unhappy. Both authors are in CLA_SIGNERS. But all commits are pre-JanusGraph. For the record unless I'm mistaken I think it would be a lot of work (e.g. rebase/conflict nightmare) to go back and update names/signatures on all those old commits. Hopefully this isn't necessary. |
@mbrukman Sorry I didn't see your response before writing mine. Commits after JanusGraph are signed but the old commits are not. I think it would be a lot of work to go back and sign those old commits. Can we pursue an exception or handle in some other way? |
@mbrukman Excellent, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some comments
@Graph.OptOut( | ||
test = "org.apache.tinkerpop.gremlin.process.computer.GraphComputerTest", | ||
method = "shouldSupportGraphFilter", | ||
reason = "Titan currently does not support graph filters but does not throw proper exception because doing so breaks numerous tests in gremlin-test ProcessComputerSuite.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should create an issue on TP to handle this exception gracefully (or provide an avenue to avoid it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the more correct statement here would be "graph filter support in JanusGraph is untested." FulgoraGraphComputer doesn't support graph filters, which is why the OptOut is needed. Note though I've recently used graph filters without issue on JanusGraph using SparkGraphCompter, for example.
If we were going to file an issue it would be that gremlin-test does not fully support computers that don't support graph filters. But I kind of think it's on JanusGraph ... update FulgoraGraphComputer to support graph filters (which I apologize I didn't do as part of this effort) or find a way to get rid of it (see discussion on this below).
#41
https://groups.google.com/forum/#!topic/janusgraph-dev/rmdVpvIJOXc
return BackendOperation.execute(exe, maxReadTime); | ||
} catch (JanusGraphException e) { | ||
// support traversal interruption | ||
// TODO: Refactor to allow direct propagation of underlying interrupt exception |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create an issue github so we can backlog the refactor
@@ -0,0 +1,35 @@ | |||
package org.janusgraph.graphdb.database.serialize.attribute; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing license header
import java.io.Serializable; | ||
import java.util.HashMap; | ||
|
||
public class SerializableSerializer<T extends Serializable> implements AttributeSerializer<T>, SerializerInjected { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need classdoc
@@ -1,22 +1,7 @@ | |||
// Copyright 2017 JanusGraph Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove the license header?
} | ||
//..but only if specifically asked for by key | ||
List<VertexProperty<V>> result = new ArrayList<>(Math.min(keys.length,vertexMemory.elementKeyMap.size())); | ||
List<VertexProperty<V>> result = new ArrayList<>(Math.min(keys.length,memoryKeys.size())); | ||
for (String key : keys) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stream.filter.forEach?
@@ -100,7 +100,7 @@ public void setMetrics(MutableMetrics metrics) { | |||
|
|||
@Override | |||
public void addHasContainer(final HasContainer hasContainer) { | |||
this.addAll(Collections.singleton(hasContainer)); | |||
this.addAll(Collections.singleton(hasContainer)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 spaces?
@@ -50,7 +50,7 @@ | |||
<dependency> | |||
<groupId>org.apache.hbase</groupId> | |||
<artifactId>hbase-server</artifactId> | |||
<version>${hbase098.version}</version> | |||
<version>${hbase098.version}</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove extra spaces
@@ -19,7 +19,7 @@ | |||
<dependency> | |||
<groupId>${project.groupId}</groupId> | |||
<artifactId>janusgraph-hadoop-core</artifactId> | |||
<version>${project.version}</version> | |||
<version>${project.version}</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove extra spaces
try { | ||
g.close(); | ||
} catch (IOException | IllegalStateException e) { | ||
logger.warn("Titan graph may not have closed cleanly", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as part of close(), is tx().commit() also called? im poking at the log level and wonder if this should be an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess this is test code. maybe we should fail() the test if we get in here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, just tx.close() (see StandardJanusGraph.closeInternal()). This was needed to resolve some sporadic test failures caused by uncaught exceptions associated with "transaction already closed". I can look at it again because I agree it would be better not to have to do this but note this class is in janusgraph-test
(e.g. it's only used in unit tests).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create an issue and move on. I do not want to block 3.2.3 support at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood thanks. I tried taking the try-catch out but I couldn't reproduce the issue in janusgraph-test or berkeleydb. So I would have had to run through the TinkerPop test suite in the cassandra and hbase modules to investigate further and each of those take 24 hours to run.
My question again is: Do we need to keep all the 19 commits going into JanusGraph commit history? There are many intermediate commits and merges that are actually for Titan code. There is really no need to list them all into JanusGraph. With all due respect to the good work done by @dylanht @sjudeng, can we simplify and clean up the commits? |
Some of the commits could be squashed, but preserving the history of interaction is also important for visibility and attribution purposes. Its not fair to @dylanht if all of his commits are squashed and he does not get credit in the heat / activity-map calendar on his profile as a contributor. |
@amcp I am with you on the due credit.
|
I know we don't have a developer document or policy yet. There is a discussion on the project dev list. |
87861c1
to
deb99a9
Compare
@sjudeng |
You can always do |
public Map<String, Object> previousMap; | ||
public Map<String, Object> currentMap; | ||
private final AtomicInteger iteration = new AtomicInteger(0); | ||
private final AtomicLong runtime = new AtomicLong(0l); | ||
private boolean inExecute = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this could be called from different threads, should add volatile
modifier to make sure changes immediately visible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx @sjudeng but looks like you may have updated the wrong variable?
The VertexMemoryHandler.inExecute
does not need to have volatile modifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry, should be good now. The real loser here is Travis CI, which now has an extra hour of building to do ...
@jerryjch We're on the same page regarding striving for a single commit per feature. On the other hand though, I don't think it would ever be appropriate to squash out another developers commits and this isn't something I'd be willing to do. I'm not sure about @dylanht but I know for my part the size of this contribution does not do justice to the amount of time it took to come up with it. I agree with @amcp that the best solution if necessary would be for @dylanht to squash commits 836b607-914eebf. I can then combine the original update (4aca6d6) and gremlin server fix (7159656) as a single commit. I'd still keep the code cleanup (a04e44c) as a separate commit as I think that's useful to separate. I also don't think I'll be able to get away from the one additional post-JanusGraph merge commit (deb99a9). |
d9fd577
to
5e12bf5
Compare
@Graph.OptOut( | ||
test = "org.apache.tinkerpop.gremlin.process.computer.GraphComputerTest", | ||
method = "shouldSupportGraphFilter", | ||
reason = "JanusGraph test graph computer (FulgoraGraphComputer} " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/}/)/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done thanks
@jerryjch, @sjudeng – I agree on having a single, atomic commit on @jerryjch and @dylanht – what's your take on @sjudeng's most recent comment? I'd like to unblock this PR and get it merged soon. |
Also once reviewers are satisfied I would like to run through the test suite one more time unless someone else is going to do it. This takes about 40 hours to complete so I'd like to wait until I have the all clear to run. |
In the interest of progress, lets timebox this effort. If @dylanht can find an opportunity in the next day to squash his commits, then let him work with @sjudeng on that (no pressure!). Otherwise, if @dylanht does not have time, it is OK for @sjudeng to go ahead and merge the commits as is, after the tests run. We should not impede progress due to the form of legacy commits. |
FulgoraGraphComputer was the primary barrier to this dependency upgrade. Between 3.1.x and 3.2.x TinkerPop made significant changes to how TinkerPop-enabled GraphComputers are implemented - in particular, FulgoraMemory, FulgoraVertexMemory, and FulgoraGraphComputer classes were updated to use the new VertexComputeKey and MemoryComputeKey models in TinkerPop. Most instructive in this effort was TinkerGraphComputer and related classes git history. In order to allow MapReduce to set MemoryComputeKeys, I altered the timing at which memory.completeSubRound() is called in FulgoraGraphComputer so that this.execute would no longer be true when MapReducers were trying to add their keys to memory. I made no effort to ensure the new transient/broadcast flags are respected, and added "this" in many places to copy the TinkerGraphComputer style explicitly. The relationship of Titan's ScanJob to TinkerGraphComputerView is still opaque to me, and many comments reflecting other doubts I had about divergent implementation details between FulgoraGraphComputer and TinkerGraphComputer are found throughout. I reflected advice in the TinkerPop 3.2.x upgrade guide re: changes to ComparatorHolder, e.g. OrderXXXStep and Traveral.Admin in signatures. However, I did not manage to update HasStepFolder.foldInHasContainers in TitanGraphStepStrategy as it was updated in TinkerGraphStepStrategy for TinkerPop 3.2.0-incubating, although it looked like a drop in. FulgoraVertexMemory.getIdMap now streams vertexProgram.getVertexComputeKeys() into a HashSet, and I added a check on features().getMaxWorkers of FulgoraGraphComputer. Also fixed incorrect class name in doc comment inside ScanJob class. TitanGraphTest had many traversals featuring a LocalStep where Titan previously expected to have a TitanVertexStep, and I changed those tests to expect LocalStep where it occurs. Also in tests accessing the "~metrics" sideEffect key that based on work by @rjbriody on profiling in TinkerPop and some tests in the console should have returned TraversalMetrics was giving me a null pointer, so I commented out calls to verifyMetrics() in TitanGraphTest. I considered the logic in QueryProfiler or TP3ProfileWrapper, HasStepFolder.foldInOrder and/or HasStepFolder.foldInHasContainer, the difference in LocalStep/TitanVertexStep expectation I saw elsewhere in the tests, and GraphStep.processHasContainerIds() which I failed to update to reflect the TinkerPop 3.2.x upgrade guide as likely candidates for this issue. Hopefully TP3ProfileWrapper is all we need to consider. TitanH1OutputFormat was changed and I am worried that it needs to respect isTransient() for persistableKeys. I updated the poms as needed, and @sjudeng figured out my initial confusion around curator recipes, which only needed to be included at the right version in the top-level pom.xml file. Signed-off-by: dylanht <[email protected]>
@amcp @mbrukman @jerryjch @sjudeng agree completely with the assessment here that my commits should be squashed despite the fact that it probably isn't the most consequential case given timing and greater importance of getting this PR through. Sorry to be so late to join in here we're in the middle of moving out/in. @sjudeng I squashed the commits on my branch at https://github.com/dylanht/titan/tree/upgrade-to-tinkerpop-3.2.0-incubating, and invited you as a collaborator in case that proves useful. I saw your merge commit here (ngageoint@d4b4618) - I would think you're planning to pull the squashed commits down and force-push to your branch on ngageoint but if you had something else in mind let me know if I can help! |
@@ -78,7 +78,7 @@ public static JanusGraphFeatures getFeatures(StandardJanusGraph graph, StoreFeat | |||
|
|||
@Override | |||
public boolean supportsMapValues() { | |||
return false; | |||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be unrelated, but is this a reversion back to the pre-1.0 support for vertex/edge property values of type map
? If I remember correctly, this was pulled out to prevent having to deal with serialization of any old type inserted as a map
value. I think this may become even more important with Gremlin language variants because we'll likely have a greater number of non-JVM based languages using JanusGraph. If we do want to support map values, perhaps we should add extra validation in to ensure that the maps values fall into some set of supported types. I haven't looked at the serialization code close enough, but perhaps the newer serialization will at least enforce the types of keys and values.
Regardless, If we're going to contemplate adding map
back in, I think that should be pulled out into a separate discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This update was to resolve test failures and involved adding an initial implementation for HashMap serialization. The implementation simply uses Java object serialization, which will throw a java.io.NotSerializableException
if the map contains unsupported types.
As noted in the PR notes there are definitely at least performance issues with using Java serialization here. Can we create a separate issue to update the initial HashMap serialization implementation to both improve performance and formalize validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you speak a bit more about the test failures that required the change? Are there TinkerPop tests that were requiring map support even with the feature disabled? Regardless, I'm ok with moving forward on this to get it merged but I'll start a discussion on the list so that we can reach consensus on whether or not map
support should be added back in and if it is, what the extra validation implications are. At that point, if we move forward with it, we can create an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for example in org.apache.tinkerpop.gremlin.process.computer.GraphComputerTest
the shouldSucceedWithProperTraverserRequirements and shouldFailWithImproperTraverserRequirements tests throw IllegalArgumentExceptions (Property value [{...}] is of type class java.util.HashMap is not supported
) with supportsMapValues=false and without the associated serialization implementation. See attached stack trace for details.
verifyMetrics(metrics.getMetrics(0), true, false); | ||
verifyMetrics(metrics.getMetrics(1), true, true); | ||
metrics = (TraversalMetrics) t.asAdmin().getSideEffects().get("~metrics"); | ||
//verifyMetrics(metrics.getMetrics(0), true, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this commented out code be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…significant updates to FulgoraGraph Computer and associated memory implementation, support for GraphSON 2.0 and support for interrupts in HBase backend. Update Gremlin server configuration to remove reference to pure nashorn ScriptEngine, which is no longer supported. Opt out of IoTest#shouldReadGraphMLWithNoEdgeLabel and GraphComputerTest#shouldSupportGraphFilter (see reasons in OptOut declarations). Skip titan-hadoop-1 tests (hadoop1 is no longer supported). Signed-off-by: sjudeng <[email protected]>
…inst titan11 Signed-off-by: sjudeng <[email protected]>
…ntation Signed-off-by: sjudeng <[email protected]>
5665f8c
to
c2431d5
Compare
Thanks @dylanht. As mentioned above I also combined two of my pre-JanusGraph commits but did keep code formatting commit separate and I also needed one post-merge commit. |
All tests (
|
I think we've had quite a long discussion on this PR, and I believe all concerns have been addressed, all the tests are passing, so we should move forward on this PR. In particular, @hsaputra, @jerryjch, and @pluradj — any other comments? If you're OK with this PR as it stands now, please feel free to approve. I am proposing we have a 24-hour comment period, and unless any objections are brought up during this time period, either I or @amcp will merge the PR. |
+1 agree Let's proceed. The number of commits are manageable now so LGTM |
a day has passed. merging this, and we can open new issues/prs if there are any questions. |
@sjudeng Do you have the test output saved? otherwise, ill just run it again. |
@sjudeng I may be seeing ghosts but on one of my feature branches i am not able to complete |
@amcp Here you go: test_all_tp32_excerpt.txt Note that output includes individual test suites as well as a total line for each module, which you want to include/exclude depending on what you're looking at. In case useful here's the Python script I used to parse and create table in #111. import os,re,sys
s = os.popen('grep -e Building -e ^Tests %s | grep -v jar' % sys.argv[1]).read()
modules = re.findall('(Building.*?)\[INFO\]',s,re.DOTALL|re.M)
print('| Module | Test Count | Time (sec) |')
print('| ------ | ---------- | ---------- |')
times = []
counts = []
for module in [module for module in modules if 'Time elapsed' in module]:
name = module.split('\n')[0].split()[1]
u = dict([(i,0) for i in re.findall('Time elapsed: .*? (.*?) ',module)])
assert(len(u)==1)
total_sec = sum(map(float,[i.replace(',','') for i in re.findall('Time elapsed: (.*?) ',module)]))
count_block = '\n'.join([line for line in module.split('\n') if 'Time' not in line])
total_count = sum(map(int,re.findall('Tests run: (\d+)',count_block)))
times.append(total_sec)
counts.append(total_count)
print('| %s | %s | %.0f |' % (name,total_count,total_sec))
print('| Total | %.0f | %.0f |' % (sum(counts),sum(times))) |
This is great. I'll put together a plan in Excel. What is the meaning of line 179 of your attachment? looks like a subtotal but it is not prefaced by anything. |
That's the total line for the default tests in janusgraph-test. Then L180-L487 are the results for the TinkerPop tests in janusgraph-test and L488 is the corresponding total. Sorry for the confusion, I didn't include the test execution name in the excerpt. I'll update the file later today. |
Update to TinkerPop 3.2.3
This PR includes commits by @dylanht and myself. All default and TinkerPop tests are passing (
mvn clean install -Dtest.skip.tp=false
). Several tests do require apache/tinkerpop#458 but in my opinion this fix is not critical to a release (e.g. it's likely just relevant to tests).Update from 3.1.1-incubating to 3.2.0-incubating
The following is an excerpt of @dylanht's notes from his original PR (May 2016):
Update from 3.2.0-incubating to 3.2.3
The following notes are from the update PR (November 2016):
GraphComputerTest#shouldSupportGraphFilter
since FulgoraGraphComputer doesn't support graph filters but also can't throw the expected exception without breaking a number of tests that otherwise passInMemoryGraphComputerProvider
, etc.) to ensure vertex ids are evenly spaced and increasing in tests.PeerPressureTest#g_V_peerPressure_byXclusterX_byXoutEXknowsXX_pageRankX1X_byXrankX_byXoutEXknowsXX_timesX2X_group_byXclusterX_byXrank_sumX
- The vertex program appears to cluster by vertex id. I don't think this will work (consistently) for JanusGraph unless clustering by some other property.UnionTest#g_VX1_2X_localXunionXoutE_count__inE_count__outE_weight_sumXX
- When the assigned id of the first vertex in the test, marko, is less than that of the second vertex, vadas, then the test passes. Otherwise the test fails. In this case the local traversal is executed twice on the second (smaller id) vertex. The issue can be resolved by cloning the local step in WorkerExecutor if the associated local traversal starts with a UnionStep ... but that's just a hack and can't be recommended to TinkerPop (especially not without a test case).References:
thinkaurelius/titan#1312
dylanht/titan#1
#41