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

Protobuf manipulation #44

Merged
merged 1 commit into from May 27, 2020

Conversation

@karesti karesti changed the title wuip Protobuf manipulation May 20, 2020
@karesti karesti force-pushed the protobuf-schema-manipulation branch from f5013ee to 1be17ff Compare May 21, 2020 19:09
@karesti karesti removed the preview label May 21, 2020
@karesti karesti requested a review from pruivo May 21, 2020 19:12
@ryanemerson
Copy link
Contributor

ryanemerson commented May 22, 2020

I encountered a few issues when using a server built from the latest Infinispan master:

  1. It's not possible to type a space when writing a schema for some reason. Copy and paste works fine.
  2. When I create a schema the dialogue does not close, I have todo it manually
  3. After creating a schema, I get a green tick in the console, however when I refresh the container page there are no schemas. I looked at the server logs and I get the following exceptions:
13:23:03,603 ERROR (non-blocking-thread--p2-t13) [org.infinispan.interceptors.impl.InvocationContextInterceptor] ISPN000136: Error executing command LockControlCommand on Cache '___protobuf_metadata', writing keys [] org.infinispan.util.concurrent.TimeoutException: ISPN000299: Unable to acquire lock after 10 seconds for key .errors and requestor GlobalTransaction{id=2, addr=localhost-16715, remote=false, xid=null, internalId=-1}. Lock is held by GlobalTransaction{id=1, addr=localhost-16715, remote=false, xid=null, internalId=-1}
	at org.infinispan.util.concurrent.locks.impl.DefaultLockManager$KeyAwareExtendedLockPromise.get(DefaultLockManager.java:292)
	at org.infinispan.util.concurrent.locks.impl.DefaultLockManager$KeyAwareExtendedLockPromise.get(DefaultLockManager.java:222)
	at org.infinispan.util.concurrent.locks.impl.InfinispanLock$LockPlaceHolder.checkState(InfinispanLock.java:440)
	at org.infinispan.util.concurrent.locks.impl.InfinispanLock$LockPlaceHolder.lambda$toInvocationStage$3(InfinispanLock.java:416)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
	at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

13:23:03,605 ERROR (blocking-thread--p3-t67) [org.infinispan.interceptors.impl.InvocationContextInterceptor] ISPN000136: Error executing command PutKeyValueCommand on Cache '___protobuf_metadata', writing keys [Test.proto] org.infinispan.util.concurrent.TimeoutException: ISPN000299: Unable to acquire lock after 10 seconds for key .errors and requestor GlobalTransaction{id=2, addr=localhost-16715, remote=false, xid=null, internalId=-1}. Lock is held by GlobalTransaction{id=1, addr=localhost-16715, remote=false, xid=null, internalId=-1}
	at org.infinispan.interceptors.impl.AsyncInterceptorChainImpl.invoke(AsyncInterceptorChainImpl.java:255)
	at org.infinispan.query.remote.impl.ProtobufMetadataManagerInterceptor.visitPutKeyValueCommand(ProtobufMetadataManagerInterceptor.java:254)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
	at org.infinispan.interceptors.BaseAsyncInterceptor.asyncInvokeNext(BaseAsyncInterceptor.java:232)
	at org.infinispan.interceptors.impl.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:739)
	at org.infinispan.interceptors.impl.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:342)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
	at org.infinispan.interceptors.DDAsyncInterceptor.handleDefault(DDAsyncInterceptor.java:53)
	at org.infinispan.interceptors.DDAsyncInterceptor.visitPutKeyValueCommand(DDAsyncInterceptor.java:59)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
	at org.infinispan.interceptors.BaseAsyncInterceptor.lambda$new$0(BaseAsyncInterceptor.java:27)
	at org.infinispan.interceptors.SyncInvocationStage.thenApply(SyncInvocationStage.java:44)
	at org.infinispan.interceptors.BaseAsyncInterceptor.asyncInvokeNext(BaseAsyncInterceptor.java:246)
	at org.infinispan.interceptors.locking.PessimisticLockingInterceptor.acquireLocalLockAndInvokeNext(PessimisticLockingInterceptor.java:286)
	at org.infinispan.interceptors.locking.PessimisticLockingInterceptor.visitDataWriteCommand(PessimisticLockingInterceptor.java:150)
	at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:82)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNextAndFinally(BaseAsyncInterceptor.java:155)
	at org.infinispan.interceptors.impl.TxInterceptor.handleWriteCommand(TxInterceptor.java:394)
	at org.infinispan.interceptors.impl.TxInterceptor.visitPutKeyValueCommand(TxInterceptor.java:227)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
	at org.infinispan.statetransfer.TransactionSynchronizerInterceptor.visitCommand(TransactionSynchronizerInterceptor.java:41)
	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNextAndHandle(BaseAsyncInterceptor.java:190)
	at org.infinispan.statetransfer.StateTransferInterceptor.handleTxWriteCommand(StateTransferInterceptor.java:259)
	at org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:249)
	at org.infinispan.statetransfer.StateTransferInterceptor.visitPutKeyValueCommand(StateTransferInterceptor.java:96)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
	at org.infinispan.interceptors.impl.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:246)
	at org.infinispan.interceptors.impl.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:210)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNextAndExceptionally(BaseAsyncInterceptor.java:128)
	at org.infinispan.interceptors.impl.InvocationContextInterceptor.visitCommand(InvocationContextInterceptor.java:90)
	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:61)
	at org.infinispan.interceptors.impl.BatchingInterceptor.handleDefault(BatchingInterceptor.java:69)
	at org.infinispan.interceptors.impl.BatchingInterceptor.visitPutKeyValueCommand(BatchingInterceptor.java:49)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
	at org.infinispan.interceptors.DDAsyncInterceptor.handleDefault(DDAsyncInterceptor.java:53)
	at org.infinispan.interceptors.DDAsyncInterceptor.visitPutKeyValueCommand(DDAsyncInterceptor.java:59)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
	at org.infinispan.interceptors.DDAsyncInterceptor.visitCommand(DDAsyncInterceptor.java:49)
	at org.infinispan.interceptors.impl.AsyncInterceptorChainImpl.invokeAsync(AsyncInterceptorChainImpl.java:226)
	at org.infinispan.cache.impl.InvocationHelper.doInvokeAsync(InvocationHelper.java:293)
	at org.infinispan.cache.impl.InvocationHelper.executeCommandAsyncWithInjectedTx(InvocationHelper.java:219)
	at org.infinispan.cache.impl.InvocationHelper.invokeAsync(InvocationHelper.java:146)
	at org.infinispan.cache.impl.InvocationHelper.invokeAsync(InvocationHelper.java:130)
	at org.infinispan.cache.impl.CacheImpl.putIfAbsentAsync(CacheImpl.java:1449)
	at org.infinispan.cache.impl.DecoratedCache.putIfAbsentAsync(DecoratedCache.java:400)
	at org.infinispan.cache.impl.DecoratedCache.putIfAbsentAsync(DecoratedCache.java:375)
	at org.infinispan.cache.impl.AbstractDelegatingCache.putIfAbsentAsync(AbstractDelegatingCache.java:211)
	at org.infinispan.cache.impl.EncoderCache.putIfAbsentAsync(EncoderCache.java:303)
	at org.infinispan.rest.resources.ProtobufResource.createOrReplace(ProtobufResource.java:114)
	at org.infinispan.rest.resources.ProtobufResource.lambda$getInvocations$0(ProtobufResource.java:58)
	at org.infinispan.rest.framework.impl.RestDispatcherImpl.dispatch(RestDispatcherImpl.java:75)
	at org.infinispan.rest.RestRequestHandler.handleRestRequest(RestRequestHandler.java:124)
	at org.infinispan.rest.RestRequestHandler.lambda$channelRead0$0(RestRequestHandler.java:103)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1705)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.infinispan.util.concurrent.TimeoutException: ISPN000299: Unable to acquire lock after 10 seconds for key .errors and requestor GlobalTransaction{id=2, addr=localhost-16715, remote=false, xid=null, internalId=-1}. Lock is held by GlobalTransaction{id=1, addr=localhost-16715, remote=false, xid=null, internalId=-1}
	at org.infinispan.util.concurrent.locks.impl.DefaultLockManager$KeyAwareExtendedLockPromise.get(DefaultLockManager.java:292)
	at org.infinispan.util.concurrent.locks.impl.DefaultLockManager$KeyAwareExtendedLockPromise.get(DefaultLockManager.java:222)
	at org.infinispan.util.concurrent.locks.impl.InfinispanLock$LockPlaceHolder.checkState(InfinispanLock.java:440)
	at org.infinispan.util.concurrent.locks.impl.InfinispanLock$LockPlaceHolder.lambda$toInvocationStage$3(InfinispanLock.java:416)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
	at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
	... 3 more
	Suppressed: org.infinispan.util.logging.TraceException
		at org.infinispan.interceptors.impl.SimpleAsyncInvocationStage.get(SimpleAsyncInvocationStage.java:39)
		at org.infinispan.interceptors.impl.AsyncInterceptorChainImpl.invoke(AsyncInterceptorChainImpl.java:246)
		at org.infinispan.query.remote.impl.ProtobufMetadataManagerInterceptor.visitPutKeyValueCommand(ProtobufMetadataManagerInterceptor.java:254)
		at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
		at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
		at org.infinispan.interceptors.BaseAsyncInterceptor.asyncInvokeNext(BaseAsyncInterceptor.java:232)
		at org.infinispan.interceptors.impl.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:739)
		at org.infinispan.interceptors.impl.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:342)
		at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
		at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
		at org.infinispan.interceptors.DDAsyncInterceptor.handleDefault(DDAsyncInterceptor.java:53)
		at org.infinispan.interceptors.DDAsyncInterceptor.visitPutKeyValueCommand(DDAsyncInterceptor.java:59)
		at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
		at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
		at org.infinispan.interceptors.BaseAsyncInterceptor.lambda$new$0(BaseAsyncInterceptor.java:27)
		at org.infinispan.interceptors.SyncInvocationStage.thenApply(SyncInvocationStage.java:44)
		at org.infinispan.interceptors.BaseAsyncInterceptor.asyncInvokeNext(BaseAsyncInterceptor.java:246)
		at org.infinispan.interceptors.locking.PessimisticLockingInterceptor.acquireLocalLockAndInvokeNext(PessimisticLockingInterceptor.java:286)
		at org.infinispan.interceptors.locking.PessimisticLockingInterceptor.visitDataWriteCommand(PessimisticLockingInterceptor.java:150)
		at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:82)
		at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
		at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNextAndFinally(BaseAsyncInterceptor.java:155)
		at org.infinispan.interceptors.impl.TxInterceptor.handleWriteCommand(TxInterceptor.java:394)
		at org.infinispan.interceptors.impl.TxInterceptor.visitPutKeyValueCommand(TxInterceptor.java:227)
		at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
		at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
		at org.infinispan.statetransfer.TransactionSynchronizerInterceptor.visitCommand(TransactionSynchronizerInterceptor.java:41)
		at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNextAndHandle(BaseAsyncInterceptor.java:190)
		at org.infinispan.statetransfer.StateTransferInterceptor.handleTxWriteCommand(StateTransferInterceptor.java:259)
		at org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:249)
		at org.infinispan.statetransfer.StateTransferInterceptor.visitPutKeyValueCommand(StateTransferInterceptor.java:96)
		at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
		at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
		at org.infinispan.interceptors.impl.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:246)
		at org.infinispan.interceptors.impl.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:210)
		at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
		at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNextAndExceptionally(BaseAsyncInterceptor.java:128)
		at org.infinispan.interceptors.impl.InvocationContextInterceptor.visitCommand(InvocationContextInterceptor.java:90)
		at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:61)
		at org.infinispan.interceptors.impl.BatchingInterceptor.handleDefault(BatchingInterceptor.java:69)
		at org.infinispan.interceptors.impl.BatchingInterceptor.visitPutKeyValueCommand(BatchingInterceptor.java:49)
		at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
		at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
		at org.infinispan.interceptors.DDAsyncInterceptor.handleDefault(DDAsyncInterceptor.java:53)
		at org.infinispan.interceptors.DDAsyncInterceptor.visitPutKeyValueCommand(DDAsyncInterceptor.java:59)
		at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
		at org.infinispan.interceptors.DDAsyncInterceptor.visitCommand(DDAsyncInterceptor.java:49)
		at org.infinispan.interceptors.impl.AsyncInterceptorChainImpl.invokeAsync(AsyncInterceptorChainImpl.java:226)
		at org.infinispan.cache.impl.InvocationHelper.doInvokeAsync(InvocationHelper.java:293)
		at org.infinispan.cache.impl.InvocationHelper.executeCommandAsyncWithInjectedTx(InvocationHelper.java:219)
		at org.infinispan.cache.impl.InvocationHelper.invokeAsync(InvocationHelper.java:146)
		at org.infinispan.cache.impl.InvocationHelper.invokeAsync(InvocationHelper.java:130)
		at org.infinispan.cache.impl.CacheImpl.putIfAbsentAsync(CacheImpl.java:1449)
		at org.infinispan.cache.impl.DecoratedCache.putIfAbsentAsync(DecoratedCache.java:400)
		at org.infinispan.cache.impl.DecoratedCache.putIfAbsentAsync(DecoratedCache.java:375)
		at org.infinispan.cache.impl.AbstractDelegatingCache.putIfAbsentAsync(AbstractDelegatingCache.java:211)
		at org.infinispan.cache.impl.EncoderCache.putIfAbsentAsync(EncoderCache.java:303)
		at org.infinispan.rest.resources.ProtobufResource.createOrReplace(ProtobufResource.java:114)
		at org.infinispan.rest.resources.ProtobufResource.lambda$getInvocations$0(ProtobufResource.java:58)
		at org.infinispan.rest.framework.impl.RestDispatcherImpl.dispatch(RestDispatcherImpl.java:75)
		at org.infinispan.rest.RestRequestHandler.handleRestRequest(RestRequestHandler.java:124)
		at org.infinispan.rest.RestRequestHandler.lambda$channelRead0$0(RestRequestHandler.java:103)
		at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
		at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
		at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
		at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1705)
		... 3 more

@karesti
Copy link
Collaborator Author

karesti commented May 22, 2020

whaaaatttt

@karesti
Copy link
Collaborator Author

karesti commented May 22, 2020

well I won't have the time to fix this now so I will release and fix all during the weekend

@anistor
Copy link
Member

anistor commented May 22, 2020

there is no weekend it seems. just a continuous stream :)

ISPN-11666 Create
ISPN-11665 Delete
ISPN-11664 Update
ISPN-11663 List
@karesti karesti force-pushed the protobuf-schema-manipulation branch from 1be17ff to 416928a Compare May 25, 2020 14:38
@karesti
Copy link
Collaborator Author

karesti commented May 25, 2020

@ryanemerson I fixed the first one but I'm able to create schemas without issue

@ryanemerson
Copy link
Contributor

Overall LGTM, just one minor bug:

  • Creating a schema with name "test." resultes in a schema being created with key "test..proto"

For the future, it would be good if you could do a multi-select of schemas and delete them all simultaneously.

@karesti
Copy link
Collaborator Author

karesti commented May 27, 2020

@ryanemerson for the schema name creation is normal beacause the .proto is added in the backend
I don't see it's a real issue for me. if someone is adding a name with a . in it, ok, like if the name ends on $

@ryanemerson
Copy link
Contributor

Sure. I just figured that a trailing . was probably unwanted and we could strip it, but maybe it's best to avoid this kind of magic.

@ryanemerson ryanemerson merged commit 405c85a into infinispan:master May 27, 2020
@ryanemerson
Copy link
Contributor

Thanks @karesti

@karesti karesti deleted the protobuf-schema-manipulation branch May 27, 2020 11:33
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

3 participants