{"action":"created","issue":{"url":"https://api.github.com/repos/pravega/pravega/issues/2644","repository_url":"https://api.github.com/repos/pravega/pravega","labels_url":"https://api.github.com/repos/pravega/pravega/issues/2644/labels{/name}","comments_url":"https://api.github.com/repos/pravega/pravega/issues/2644/comments","events_url":"https://api.github.com/repos/pravega/pravega/issues/2644/events","html_url":"https://github.com/pravega/pravega/issues/2644","id":328203288,"node_id":"MDU6SXNzdWUzMjgyMDMyODg=","number":2644,"title":"Reader group initialization should respect truncation point","user":{"login":"EronWright","id":1775518,"node_id":"MDQ6VXNlcjE3NzU1MTg=","avatar_url":"https://avatars0.githubusercontent.com/u/1775518?v=4","gravatar_id":"","url":"https://api.github.com/users/EronWright","html_url":"https://github.com/EronWright","followers_url":"https://api.github.com/users/EronWright/followers","following_url":"https://api.github.com/users/EronWright/following{/other_user}","gists_url":"https://api.github.com/users/EronWright/gists{/gist_id}","starred_url":"https://api.github.com/users/EronWright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EronWright/subscriptions","organizations_url":"https://api.github.com/users/EronWright/orgs","repos_url":"https://api.github.com/users/EronWright/repos","events_url":"https://api.github.com/users/EronWright/events{/privacy}","received_events_url":"https://api.github.com/users/EronWright/received_events","type":"User","site_admin":false},"labels":[{"id":416452764,"node_id":"MDU6TGFiZWw0MTY0NTI3NjQ=","url":"https://api.github.com/repos/pravega/pravega/labels/area/controller","name":"area/controller","color":"c2e0c6","default":false},{"id":406474440,"node_id":"MDU6TGFiZWw0MDY0NzQ0NDA=","url":"https://api.github.com/repos/pravega/pravega/labels/kind/bug","name":"kind/bug","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-05-31T16:08:47Z","updated_at":"2018-06-06T14:07:24Z","closed_at":null,"author_association":"COLLABORATOR","body":"**Problem description**\r\nWhen a reader group is created (or reset) with a configuration not containing a start position, the start position is implicitly set to the head of the stream.   Issue: the underlying calculation is not respecting segment truncation and simply assumes an offset of zero for the available segments.   In reality the offset may be non-zero.  \r\n\r\nThe issue causes a truncation exception, such as seen below (following a reset of the RG with name `hulksmallScaleforgetful0`).  Observe that the initial offset of `hulk/smallScale/53` is `0` yet the subsequent response of `SegmentIsTruncated` makes clear that `startOffset` is `1189328`.\r\n\r\n```\r\n2018-05-30 00:36:13,589 10806536 [pool-8-thread-4] INFO  c.e.n.h.t.w.readers.PravegaReader - Added Reader HulkSmallScale7d669bdb9f2f4e7fbd9c35969f9ec4f9 To ReaderGroup hulksmallScaleforgetful0\r\n\r\n2018-05-30 00:36:13,602 10806549 [pool-8-thread-4] INFO  i.p.c.s.impl.EventStreamReaderImpl - EventStreamReaderImpl( id=HulkSmallScale7d669bdb9f2f4e7fbd9c35969f9ec4f9) acquiring segments {hulk/smallScale/76=0, hulk/smallScale/79=0, hulk/smallScale/74=0, hulk/smallScale/70=0, hulk/smallScale/96=0, hulk/smallScale/97=0, hulk/smallScale/98=0, hulk/smallScale/67=0, hulk/smallScale/92=0, hulk/smallScale/93=0, hulk/smallScale/94=0, hulk/smallScale/95=0, hulk/smallScale/88=0, hulk/smallScale/89=0, hulk/smallScale/90=0, hulk/smallScale/58=0, hulk/smallScale/91=0, hulk/smallScale/84=0, hulk/smallScale/53=0, hulk/smallScale/86=0, hulk/smallScale/87=0, hulk/smallScale/81=0, hulk/smallScale/82=0}\r\n\r\n2018-05-30 00:36:14,028 10806975 [epollEventLoopGroup-5-4] INFO  i.p.c.s.i.AsyncSegmentInputStreamImpl - Received segmentIsTruncated WireCommands.SegmentIsTruncated(type=SEGMENT_IS_TRUNCATED, requestId=0, segment=hulk/smallScale/53, startOffset=1189328)\r\n2018-05-30 00:36:14,028 10806975 [epollEventLoopGroup-5-4] WARN  i.p.c.s.i.AsyncSegmentInputStreamImpl - Exception while reading from Segment : hulk/smallScale/53\r\nio.pravega.client.segment.impl.SegmentTruncatedException: null\r\n```\r\n\r\n**Problem location**\r\n`ReaderGroupImpl::getSegmentsForStreams` -> `ControllerService::getSegmentsAtTime`\r\n\r\n**Suggestions for an improvement**\r\n- Adjust `ControllerService::getSegmentsAtTime` to return the `startOffset` of the respective segment.\r\n- undo the duplicative logic that was added to BatchClient in #2551"},"comment":{"url":"https://api.github.com/repos/pravega/pravega/issues/comments/395081407","html_url":"https://github.com/pravega/pravega/issues/2644#issuecomment-395081407","issue_url":"https://api.github.com/repos/pravega/pravega/issues/2644","id":395081407,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTA4MTQwNw==","user":{"login":"jkhalack","id":25368596,"node_id":"MDQ6VXNlcjI1MzY4NTk2","avatar_url":"https://avatars2.githubusercontent.com/u/25368596?v=4","gravatar_id":"","url":"https://api.github.com/users/jkhalack","html_url":"https://github.com/jkhalack","followers_url":"https://api.github.com/users/jkhalack/followers","following_url":"https://api.github.com/users/jkhalack/following{/other_user}","gists_url":"https://api.github.com/users/jkhalack/gists{/gist_id}","starred_url":"https://api.github.com/users/jkhalack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkhalack/subscriptions","organizations_url":"https://api.github.com/users/jkhalack/orgs","repos_url":"https://api.github.com/users/jkhalack/repos","events_url":"https://api.github.com/users/jkhalack/events{/privacy}","received_events_url":"https://api.github.com/users/jkhalack/received_events","type":"User","site_admin":false},"created_at":"2018-06-06T14:07:24Z","updated_at":"2018-06-06T14:07:24Z","author_association":"COLLABORATOR","body":"With my above comment I tried to provide the logs on where the truncation point was, where the reader group was trying to be reset to (just segments, no offsets), and what happened as a result."}}
{"actor":{"display_login":"jkhalack"}}