From commits-return-70934-archive-asf-public=cust-asf.ponee.io@beam.apache.org Tue May 8 00:24:07 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 5F550180648 for ; Tue, 8 May 2018 00:24:06 +0200 (CEST) Received: (qmail 82662 invoked by uid 500); 7 May 2018 22:24:05 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 82653 invoked by uid 99); 7 May 2018 22:24:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2018 22:24:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 079C918048C for ; Mon, 7 May 2018 22:24:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id oi1-pq11GcN5 for ; Mon, 7 May 2018 22:24:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 672A45FAD2 for ; Mon, 7 May 2018 22:24:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 83E46E0F13 for ; Mon, 7 May 2018 22:24:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 358BF21298 for ; Mon, 7 May 2018 22:24:00 +0000 (UTC) Date: Mon, 7 May 2018 22:24:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work logged] (BEAM-3516) SpannerWriteGroupFn does not respect mutation limits MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/BEAM-3516?focusedWorklogId=3D9= 9239&page=3Dcom.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpane= l#worklog-99239 ] ASF GitHub Bot logged work on BEAM-3516: ---------------------------------------- Author: ASF GitHub Bot Created on: 07/May/18 22:23 Start Date: 07/May/18 22:23 Worklog Time Spent: 10m=20 Work Description: NathanHowell commented on issue #4860: [BEAM-3516] = Spanner BatchFn does not respect mutation limits URL: https://github.com/apache/beam/pull/4860#issuecomment-387225204 =20 =20 @mairbek I know... we're still using Beam though =F0=9F=91=8D =F0=9F=98= =83 thanks for picking it up! ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 99239) Time Spent: 2h 20m (was: 2h 10m) > SpannerWriteGroupFn does not respect mutation limits > ---------------------------------------------------- > > Key: BEAM-3516 > URL: https://issues.apache.org/jira/browse/BEAM-3516 > Project: Beam > Issue Type: Bug > Components: runner-dataflow > Affects Versions: 2.2.0 > Reporter: Ryan Gordon > Assignee: Chamikara Jayalath > Priority: Major > Time Spent: 2h 20m > Remaining Estimate: 0h > > When using SpannerIO.write(), if it happens to be a large batch or a tabl= e with indexes its very possible it can hit the Spanner Mutations Limitatio= n and fail with the following error: > {quote}Jan 02, 2018 2:42:59 PM org.apache.beam.runners.dataflow.util.Moni= toringUtil$LoggingHandler process > SEVERE: 2018-01-02T22:42:57.873Z: (3e7c871d215e890b): com.google.cloud.sp= anner.SpannerException: INVALID_ARGUMENT: io.grpc.StatusRuntimeException: I= NVALID_ARGUMENT: The transaction contains too many mutations. Insert and up= date operations count with the multiplicity of the number of columns they a= ffect. For example, inserting values into one key column and four non-key c= olumns count as five mutations total for the insert. Delete and delete rang= e operations count as one mutation regardless of the number of columns affe= cted. The total mutation count includes any changes to indexes that the tra= nsaction generates. Please reduce the number of writes, or use fewer indexe= s. (Maximum number: 20000) > links { > description: "Cloud Spanner limits documentation." > url: "https://cloud.google.com/spanner/docs/limits" > } > at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerExceptionPr= eformatted(SpannerExceptionFactory.java:119) > at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException(= SpannerExceptionFactory.java:43) > at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException(= SpannerExceptionFactory.java:80) > at com.google.cloud.spanner.spi.v1.GrpcSpannerRpc.get(GrpcSpannerRpc.jav= a:404) > at com.google.cloud.spanner.spi.v1.GrpcSpannerRpc.commit(GrpcSpannerRpc.= java:376) > at com.google.cloud.spanner.SpannerImpl$SessionImpl$2.call(SpannerImpl.j= ava:729) > at com.google.cloud.spanner.SpannerImpl$SessionImpl$2.call(SpannerImpl.j= ava:726) > at com.google.cloud.spanner.SpannerImpl.runWithRetries(SpannerImpl.java:= 200) > at com.google.cloud.spanner.SpannerImpl$SessionImpl.writeAtLeastOnce(Spa= nnerImpl.java:725) > at com.google.cloud.spanner.SessionPool$PooledSession.writeAtLeastOnce(S= essionPool.java:248) > at com.google.cloud.spanner.DatabaseClientImpl.writeAtLeastOnce(Database= ClientImpl.java:37) > at org.apache.beam.sdk.io.gcp.spanner.SpannerWriteGroupFn.flushBatch(Spa= nnerWriteGroupFn.java:108) > at org.apache.beam.sdk.io.gcp.spanner.SpannerWriteGroupFn.processElement= (SpannerWriteGroupFn.java:79) > {quote} > =C2=A0 > As a workaround we can override the "withBatchSizeBytes" to something muc= h smaller: > {quote}mutations.apply("Write", SpannerIO > =C2=A0 =C2=A0.write() > =C2=A0 =C2=A0// Artificially reduce the max batch size=C2=A0b/c the batch= er currently doesn't > =C2=A0 =C2=A0// take into account the 20000 mutation multiplicity limit > =C2=A0 =C2=A0.withBatchSizeBytes(1024) // 1KB > =C2=A0 =C2=A0.withProjectId("#PROJECTID#") > =C2=A0 =C2=A0.withInstanceId("#INSTANCE#") > =C2=A0 =C2=A0.withDatabaseId("#DATABASE#") > ); > {quote} > While this is not as efficient, it at least allows it to work consistentl= y -- This message was sent by Atlassian JIRA (v7.6.3#76005)